* contrib/hbamf/tests/tstendin.prg
* contrib/hbgt/tests/test.prg
* contrib/hbmisc/stringp.prg
* contrib/hbmisc/tests/readfile.prg
* contrib/hbmisc/tests/testhbf.prg
* contrib/hbmysql/tests/test.prg
* contrib/hbmysql/tmysql.prg
* contrib/hbnf/doc/en/*.txt
* contrib/hbnf/tests/*.prg
* contrib/hbsqlit3/tests/*.prg
* contrib/hbssl/tests/pem.prg
* contrib/hbziparc/doc/en/hbziparc.txt
* doc/en/objfunc.txt
* doc/en/rdddb.txt
* doc/en/rddmisc.txt
* doc/en/string.txt
* tests/clasinit.prg
* tests/debugtst.prg
* tests/dynobj.prg
* tests/funcarr.prg
* tests/inherit.prg
* tests/objarr.prg
* tests/objasign.prg
* tests/stripem.prg
* cleanups
64 lines
1.2 KiB
Plaintext
64 lines
1.2 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
//
|
|
// Function Array syntax test
|
|
//
|
|
// Written by Eddie Runia <eddie@runia.com>
|
|
// www - http://harbour-project.org
|
|
//
|
|
// Placed in the public domain
|
|
//
|
|
|
|
PROCEDURE Main()
|
|
|
|
LOCAL a
|
|
|
|
? "Direct reference : ", aFunc()[ 1 ]
|
|
|
|
a := aFunc()
|
|
? "Ref via array : ", a[ 1 ]
|
|
|
|
aFunc()[ 1 ] := "Something different"
|
|
? "Assign new text : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] := 4
|
|
? "Assign 4 : ", aFunc()[ 1 ]
|
|
|
|
? "Post increment : ", aFunc()[ 1 ]++
|
|
? "After : ", aFunc()[ 1 ]
|
|
? "Pre decrement : ", --aFunc()[ 1 ]
|
|
? "After : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] += 2
|
|
? "Plus 2 : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] -= 3
|
|
? "Minus 3 : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] *= 3
|
|
? "Times 3 : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] /= 1.5
|
|
? "Divide by 1.5 : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] %= 4
|
|
? "Modulus 4 : ", aFunc()[ 1 ]
|
|
|
|
aFunc()[ 1 ] ^= 3
|
|
? "To the power 3 : ", aFunc()[ 1 ]
|
|
|
|
? "Global stack"
|
|
? hb_ValToExp( __dbgVMStkGList() ) // Please note a is a reference to aArray !
|
|
? "Statics"
|
|
? hb_ValToExp( __dbgVMVarSList() )
|
|
|
|
RETURN
|
|
|
|
FUNCTION aFunc()
|
|
|
|
STATIC aArray := { [Test] }
|
|
|
|
RETURN aArray
|