!
!  Purpose: (Subroutine used by test_results.mm)
!          1) Given the name of a results parameter that exists in the
!             calling macro, assign a value to the parameter.
!             Analogous to setting a results variable in the calling macro.
!          2) Check to make sure this macro does not have access
!             to the parent macros LOCAL results
!
!  Author :  Ken Smith/Jay Hallam
!
!  Version:  $Id: sub_results.mm,v 1.5 2008/09/18 13:30:49 jwb Exp $
!---------------------------------------------------------

startmacro u:output
!  <output> = name of a results parameter allocated by the caller

global ^output

! Set the value of the named results parameter to a known value
!result d:^output 123.
say "!!!!!!!SHOULD SEE WARNING BELOW!!!!!!!!!!!!!"
result/parent/global d:^output 123

! This macro should NOT have access to this results (
! a parent's local result)
assert/text="TEST_RESULTS: access to parent local vars created at parent" &
      A_PARENT_LOCAL_RESULT NREXISTS

res/parent d:newtest 456.
assert/text="TEST_RESULTS: access to parent local vars created at child" &
      newtest NREXISTS
endmacro
