Files
harbour-core/harbour/tests/statics.prg
Viktor Szakats 33e201a481 2012-07-20 21:01 UTC+0200 Viktor Szakats (vszakats syenar.net)
* contrib/hbct/tests/charhist.prg
  * contrib/hbct/tests/csetarge.prg
  * contrib/hbgd/tests/gdtestcl.prg
  * examples/hbapollo/array.prg
  * examples/httpsrv/uhttpd.prg
    * formatting

  * contrib/hbmisc/tests/rtfclass.prg
    ! fixes

  * contrib/hbmisc/tests/rtfclass.prg
  * contrib/hbgd/tests/gdtestcl.prg
    ! fixed to not use OS() with string
      comparisons to detect host OS

  * contrib/gtwvg/wvgdlg.prg
  * contrib/hbide/ideactions.prg
  * contrib/hbide/ideconsole.prg
  * contrib/hbide/idemain.prg
  * contrib/hbide/idemisc.prg
  * contrib/hbide/idetags.prg
  * contrib/hbxbp/tests/xbpqtc.prg
  * examples/gfspell/spell.prg
  * examples/gtwvw/tests/cbtest6.prg
  * examples/gtwvw/tests/ebtest7.prg
  * examples/gtwvw/tests/prog0.prg
  * examples/gtwvw/tests/prog1.prg
  * examples/gtwvw/tests/prog2.prg
  * examples/gtwvw/tests/wvwtest9.prg
  * examples/hbvpdf/hbvpdf.prg
  * examples/hbxlsxml/xlsxml_y.prg
  * examples/hbxlsxml/xlsxml.prg
  * tests/codebloc.prg
  * tests/langmsg.prg
  * tests/memvar.prg
  * tests/statics.prg
  * tests/testwarn.prg
  * tests/tstmacro.prg
    % removed superfluous parantheses from RETURN statements

  * examples/hbapollo/tests/test65.prg
  * examples/hbapollo/tests/test66.prg
  * examples/hbapollo/tests/test77.prg
    ! fixed looking for Windows in fixed location

  * examples/hbapollo/tests/test25.prg
  * examples/hbapollo/tests/test34.prg
  * examples/hbapollo/tests/test35.prg
  * examples/hbapollo/tests/test36.prg
  * examples/hbapollo/tests/test37.prg
  * examples/hbapollo/tests/test38.prg
  * examples/hbapollo/tests/test49.prg
  * examples/hbapollo/tests/test53.prg
  * examples/hbapollo/tests/test56.prg
  * examples/hbapollo/tests/test57.prg
  * examples/hbapollo/tests/test58.prg
    ! removed most hard-wired windows locations
2012-07-20 19:10:42 +00:00

67 lines
867 B
Plaintext

/*
* $Id$
*/
// Testing Harbour statics variables management
STATIC s_z := "First"
PROCEDURE Main()
LOCAL i, cb
STATIC a := "Hello", b := { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
QOut( a )
QOut( b[ 2 ] )
Two()
QOut( "Ok!" )
FOR i := 1 TO 10
NumStat()
NEXT
cb := DetachVar( 10 )
FOR i := 1 TO 10
QOut( Eval( cb, b[ i ] ) )
NEXT
RETURN
FUNCTION Two()
STATIC a := "Test"
QOut( a )
RETURN NIL
FUNCTION THREE( p )
QOut( p )
RETURN p
PROCEDURE NumStat( a )
STATIC s_n := 1
LOCAL cb
// STATIC m := s_n // uncomment it to see an error
// STATIC m := Time() // uncomment it to see an error
cb := {| x | s_z + Str( x ) }
QOut( ++s_n )
QOut( Eval( cb, s_n ) )
RETURN
FUNCTION DetachVar( xLocal )
STATIC xStatic := 100
RETURN {| x | ++xStatic, x + xStatic + xLocal }