Files
harbour-core/harbour/tests/funcarr.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

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 s_aArray := { [Test] }
RETURN s_aArray