Files
harbour-core/tests/passref.prg
vszakats 9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00

25 lines
428 B
Plaintext

/* test of pass by reference @ */
PROCEDURE Main()
LOCAL a := 10
LOCAL b := "X"
? 'a := 10', a
? 'b := "X"', b
testfun( @a, @b )
? 'return of "a" should = 20', a, iif( a == 20, "worked", "failed" )
? 'return of "b" should = A', b, iif( b == "A", "worked", "failed" )
RETURN
FUNCTION testfun( b, c )
b := b + 10
c := "A"
? 'a pointer + 10 =', b
? 'b pointer := "A" =', c
RETURN NIL