Files
harbour-core/tests/passref.prg
vszakats a4a357a18b 2013-03-15 11:12 UTC+0100 Viktor Szakats (harbour syenar.net)
* /harbour/* -> /*
    * moved whole Harbour source tree one level up to
      avoid single 'harbour' top dir
2013-03-15 11:13:30 +01:00

29 lines
444 B
Plaintext

/*
* $Id$
*/
/* 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