home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR22
/
JORF21_2.ZIP
/
INDIRECT.J
< prev
next >
Wrap
Text File
|
1993-07-05
|
1KB
|
30 lines
Indirect:Start
New (Foo,Fee)
Foo = 7
Fee = 7
Win:Add("Indirection Example",0,0,15,50,Here)
Str:PutLine('This test program shows the result of method that')
Str:PutLIne('uses an "Indirect" parameter to change the value ')
Str:PutLIne('of a variable in the calling method. In this ')
Str:PutLIne('example, Foo is indirect, Fee is normal. ')
Str:PutLIne('Although the subroutine changes the value of both')
Str:PutLIne('variables, when you return from the subroutine, ')
Str:PutLIne('only Foo has been changed, because the called ')
Str:PutLIne('method specified Foo as an indirect value.' )
Str:PutLIne()
Str:PutLine(" At start Foo is {Foo}, Fee is {Fee}")
Str:PutLine()
Indirect:Increment(Foo, Fee, 8, 8)
Str:PutLine(" At end Foo is now {Foo}, Fee is {Fee}")
Win:Pause
Return
Indirect:Increment(*Foo,Fee)
++Foo
++Fee
Str:PutLine(" In Increment method Foo is now {Foo}, Fee is {Fee}")
Str:PutLine()
Return (Ok)