Files
harbour-core/harbour/tests/byref.prg
Viktor Szakats 6831364d2f 2012-10-15 04:12 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/tests/activex.prg
  * contrib/gtwvg/tests/demowvg.prg
  * contrib/gtwvg/tests/demowvg1.prg
  * contrib/gtwvg/tests/demoxbp.prg
  * contrib/gtwvg/tests/tbrowser.prg
  * contrib/hbhpdf/tests/harupdf.prg
  * contrib/hbmisc/fileread.prg
  * contrib/xhb/tcgi.prg
  * extras/gtwvw/tests/ebtest7.prg
  * extras/gtwvw/tests/maximize.prg
  * extras/gtwvw/tests/wvwtest9.prg
  * extras/hbxlsxml/xlsxml.prg
  * extras/httpsrv/session.prg
  * tests/alias.prg
  * tests/begin.prg
  * tests/byref.prg
  * tests/funcarr.prg
  * tests/testwarn.prg
  * tests/wvtext.prg
    * renamed STATIC vars to start with 's_'
    * renamed PUBLIC/PRIVATE vars to start with 'p_'
    * renamed STATIC "const" vars to start with 'sc_'

  * contrib/hbhpdf/tests/harupdf.prg
    ! fixed unused STATIC function warnings

  * contrib/hbmisc/tests/rtfclass.prg
    + changed low-level class creation to hbclass.ch one
2012-10-15 02:16:10 +00:00

62 lines
863 B
Plaintext

/*
* $Id$
*/
// Managing variables by reference
PROCEDURE Main()
STATIC s_x := 10
LOCAL x := 0
? "Managing LOCAL variables by reference"
? "In main before ref1 x=", x
ref1( @x )
? " In main after ref1 x=", x
? "Managing STATIC variables by reference"
? "In main before ref1 s=", s_x
ref1( @s_x )
? " In main after ref1 s=", s_x
RETURN
FUNCTION ref1( x )
x++
? " In ref1 before ref2 =", x
Ref2( @x )
? " In ref1 after ref2 =", x
RETURN NIL
FUNCTION ref2( x )
x++
? " In ref2 before ref3 =", x
Ref3( @x )
? " In ref2 after ref3 =", x
RETURN NIL
FUNCTION ref3( x )
STATIC s_a
x++
? " In ref3 before ref4 =", x
s_a := { x, x }
Ref4( @s_a )
? " In ref3 after ref4 =", x
RETURN NIL
FUNCTION ref4( a )
a[ 1 ]++
? " In ref4 =", a[ 1 ]
RETURN NIL