Files
harbour-core/harbour/tests/working/funcarr.prg
1999-06-12 07:11:51 +00:00

54 lines
1.1 KiB
Plaintext

//
// Function Array syntax test
//
Function Main
local a
QOut( "Direct reference : ", aFunc()[1] )
a := aFunc()
QOut( "Ref via array : ", a[1] )
aFunc()[1] := "Something different"
QOut( "Assign new text : ", aFunc()[1] )
aFunc()[1] := 4
QOut( "Assign 4 : ", aFunc()[1] )
QOut( "Post increment : ", aFunc()[1]++ )
QOut( "After : ", aFunc()[1] )
QOut( "Pre decrement : ", --aFunc()[1] )
QOut( "After : ", aFunc()[1] )
aFunc()[1] += 2
QOut( "Plus 2 : ", aFunc()[1] )
aFunc()[1] -= 3
QOut( "Minus 3 : ", aFunc()[1] )
aFunc()[1] *= 3
QOut( "Times 3 : ", aFunc()[1] )
aFunc()[1] /= 1.5
QOut( "Divide by 1.5 : ", aFunc()[1] )
aFunc()[1] %= 4
QOut( "Modulus 4 : ", aFunc()[1] )
aFunc()[1] ^= 3
QOut( "To the power 3 : ", aFunc()[1] )
QOut( "Global stack" )
Debug( __aGlobalStack() ) // Please note a is a reference to aArray !
QOut( "Statics")
Debug( __aStatic() )
return NIL
Function aFunc()
static aArray := { [Test] }
return aArray