Files
harbour-core/harbour/tests/fortest.prg
Viktor Szakats 70140e5aed 2012-07-22 23:52 UTC+0200 Viktor Szakats (vszakats syenar.net)
* contrib/hbct/tests/ctwtest.prg
  * contrib/hbcups/tests/test.prg
  * contrib/hbfbird/tests/stress.prg
  * contrib/hbnf/aredit.prg
  * contrib/hbnf/doc/en/aredit.txt
  * contrib/hbnf/menu1.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/hbpgsql/tests/async.prg
  * contrib/hbpgsql/tests/cache.prg
  * contrib/hbpgsql/tests/stress.prg
  * contrib/hbpgsql/tests/test.prg
  * contrib/hbtip/tests/tiptest.prg
  * contrib/xhb/tests/compress.prg
  * doc/en/sayget.txt
  * src/rtl/profiler.prg
  * tests/ac_test.prg
  * tests/boxtst2.prg
  * tests/fortest.prg
  * tests/menutest.prg
  * tests/mt/mttest11.prg
  * tests/parseini.prg
  * tests/speedold.prg
  * tests/tstchbx.prg
  * tests/usrrdd/exarr.prg
  * tests/videotst.prg
  * tests/vidtest.prg
    * formatting
    ! deleted SetMode()s
    * CLEAR SCREEN -> CLS
    * other minor cleanups
2012-07-22 21:54:14 +00:00

73 lines
1.3 KiB
Plaintext

/*
* $Id$
*/
// Testing Harbour For Next loops for Clipper compatibility
// ; Donated to the public domain by
// Viktor Szakats (harbour syenar.net)
// TODO: add test for "step 0"
#ifndef __HARBOUR__
#xtranslate hb_eol() => ( Chr( 13 ) + Chr( 10 ) )
#endif
STATIC snFrom
STATIC snTo
STATIC snStep
PROCEDURE Main()
LOCAL array
LOCAL tmp, n
QOut( "Testing Harbour For Next loops." )
array := { ;
{ 1, 10, 1 }, ;
{ 10, 1, -1 }, ;
{ 1, 10, -1 }, ;
{ 10, 1, 1 }, ;
{ 1, 10, 4 }, ;
{ 10, 1, -4 }, ;
{ 1, 10, -4 }, ;
{ 10, 1, 4 } }
FOR tmp := 1 TO Len( array )
snFrom := array[ tmp ][ 1 ]
snTo := array[ tmp ][ 2 ]
snStep := array[ tmp ][ 3 ]
OutStd( " From: " ) ; OutStd( snFrom )
OutStd( " To: " ) ; OutStd( snTo )
OutStd( " Step: " ) ; OutStd( snStep )
OutStd( hb_eol() )
FOR n := Eval( {|| ValFrom() } ) TO Eval( {|| ValTo() } ) STEP Eval( {|| ValStep() } )
OutStd( "Exec " ) ; OutStd( n ) ; OutStd( hb_eol() )
NEXT n
NEXT
RETURN
STATIC FUNCTION ValFrom()
OutStd( "From" ) ; OutStd( hb_eol() )
RETURN snFrom
STATIC FUNCTION ValTo()
OutStd( "To" ) ; OutStd( hb_eol() )
RETURN snTo
STATIC FUNCTION ValStep()
OutStd( "Step" ) ; OutStd( hb_eol() )
RETURN snStep