home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR22 / JORF21_2.ZIP / INDIRECT.J < prev    next >
Text File  |  1993-07-05  |  1KB  |  30 lines

  1. Indirect:Start
  2.   New (Foo,Fee)
  3.   Foo = 7
  4.   Fee = 7
  5.   Win:Add("Indirection Example",0,0,15,50,Here)
  6.   Str:PutLine('This test program shows the result of method that')
  7.   Str:PutLIne('uses an "Indirect" parameter to change the value ')
  8.   Str:PutLIne('of a variable in the calling method.  In this    ')
  9.   Str:PutLIne('example, Foo is indirect, Fee is normal.       ')
  10.   Str:PutLIne('Although the subroutine changes the value of both')
  11.   Str:PutLIne('variables, when you return from the subroutine,  ')
  12.   Str:PutLIne('only Foo has been changed, because the called   ')
  13.   Str:PutLIne('method specified Foo as an indirect value.'      )
  14.   Str:PutLIne()
  15.   Str:PutLine("   At start            Foo is     {Foo}, Fee is {Fee}")
  16.   Str:PutLine()
  17.   Indirect:Increment(Foo, Fee, 8, 8)
  18.   Str:PutLine("   At end              Foo is now {Foo}, Fee is {Fee}")
  19.   Win:Pause
  20.   Return
  21.  
  22. Indirect:Increment(*Foo,Fee)
  23.   ++Foo
  24.   ++Fee
  25.   Str:PutLine("   In Increment method Foo is now {Foo}, Fee is {Fee}")
  26.   Str:PutLine()
  27.   Return (Ok)
  28.  
  29.  
  30.