diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 92a92fcdbd..364cdff1c1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,42 @@ The license applies to all entries newer than 2009-04-28. */ +2012-07-19 10:23 UTC+0200 Viktor Szakats (harbour syenar.net) + * tests/arrayidx.prg + * tests/brwpos.prg + * tests/clasinit.prg + * tests/clsicast.prg + * tests/clsscast.prg + * tests/clsscope.prg + * tests/codebl.prg + * tests/codebloc.prg + * tests/cpinfo.prg + * tests/db_brows.prg + * tests/destruct.prg + * tests/dynobj.prg + * tests/flink.prg + * tests/fortest.prg + * tests/fsplit.prg + * tests/inherit.prg + * tests/keywords.prg + * tests/multiarg.prg + * tests/newrdd.prg + * tests/onidle.prg + * tests/overload.prg + * tests/rto_get.prg + * tests/setkeys.prg + * tests/speedtst.prg + * tests/stripem.prg + * tests/tb1.prg + * tests/testbrw.prg + * tests/testdbf.prg + * tests/testhtml.prg + * tests/testwarn.prg + * tests/tstblock.prg + * tests/tstmacro.prg + * tests/wvtext.prg + * more cleanups + 2012-07-19 01:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/hbqreportsmanager.prg * contrib/hbide/idebrowse.prg @@ -30,8 +66,8 @@ * contrib/hbide/idethemes.prg * contrib/hbide/idetools.prg * contrib/hbide/idewizard.prg - ! Changed: signal/event handelling via numeric representation - instead of character strings. This completes this part of + ! Changed: signal/event handelling via numeric representation + instead of character strings. This completes this part of optimizations. 2012-07-19 09:52 UTC+0200 Viktor Szakats (harbour syenar.net) diff --git a/harbour/tests/arrayidx.prg b/harbour/tests/arrayidx.prg index a742de262e..c1f19e149c 100644 --- a/harbour/tests/arrayidx.prg +++ b/harbour/tests/arrayidx.prg @@ -5,8 +5,6 @@ // // Array Index tests // -// Date : 1999/05/14 -// // Written by Eddie Runia // www - http://harbour-project.org // diff --git a/harbour/tests/brwpos.prg b/harbour/tests/brwpos.prg index 91b96f7565..d0ecc5ab2c 100644 --- a/harbour/tests/brwpos.prg +++ b/harbour/tests/brwpos.prg @@ -2,69 +2,69 @@ * $Id$ */ -/******************************************************** -* TEST BROWSE ROWPOS FOR COMPILER IN CLIPPER AND HARBOUR -*********************************************************/ -static s_nRecNo := 1 -static s_nLastRec := 100 -static s_lFixPos := .F. +/* TEST BROWSE ROWPOS FOR COMPILER IN CLIPPER AND HARBOUR */ -Procedure Main() - Local nRow := 1 +STATIC s_nRecNo := 1 +STATIC s_nLastRec := 100 +STATIC s_lFixPos := .F. - Cls - @ 0,4 say 'Is current RecNo but not repositioned until FixPos .T. Change FixPos' - @ MaxRow(),1 say 'Please press to select or to exit and to FixPos is ' - while( LastKey() != 27 ) - @ 0,0 say s_nRecNo picture '###' - @ MaxRow(),68 say iif(s_lFixPos, '.T.','.F.') +PROCEDURE Main() + + LOCAL nRow := 1 + + CLS + @ 0, 4 SAY "Is current RecNo but not repositioned until FixPos .T. Change FixPos" + @ MaxRow(), 1 SAY "Please press to select or to exit and to FixPos is " + WHILE LastKey() != 27 + @ 0, 0 SAY s_nRecNo PICTURE "###" + @ MaxRow(), 68 SAY iif( s_lFixPos, ".T.", ".F." ) nRow := TestBrw( nRow ) - enddo -return + ENDDO -Function TestBrw( nRowIni ) - Local nKey, oBrw := TBrowseNew( 1, 0, MaxRow() - 1, MaxCol() ) + RETURN - oBrw:SkipBlock := { | n | n := iif( n < 0, max( n, 1 - s_nRecNo ), ; - min( s_nLastRec - s_nRecNo, n ) ), ; - s_nRecNo += n, n } - oBrw:GoTopBlock := { || s_nRecNo := 1 } - oBrw:GoBottomBlock := { || s_nRecNo := s_nLastRec } - oBrw:AddColumn( TBColumnNew( 'RecNo #', {|| s_nRecNo } ) ) +FUNCTION TestBrw( nRowIni ) - if( s_lFixPos .and. nRowIni > 1 ) + LOCAL nKey, oBrw := TBRowseNew( 1, 0, MaxRow() - 1, MaxCol() ) + + oBrw:SkipBlock := {| n | n := iif( n < 0, Max( n, 1 - s_nRecNo ), ; + Min( s_nLastRec - s_nRecNo, n ) ), ; + s_nRecNo += n, n } + oBrw:GoTopBlock := {|| s_nRecNo := 1 } + oBrw:GoBottomBlock := {|| s_nRecNo := s_nLastRec } + oBrw:AddColumn( TBColumnNew( "RecNo #", {|| s_nRecNo } ) ) + + IF s_lFixPos .AND. nRowIni > 1 Eval( oBrw:skipBlock, 1 - nRowIni ) - endif + ENDIF oBrw:rowPos := nRowIni - while( .T. ) - while( !oBrw:stabilize() ) - enddo + WHILE .T. + WHILE ! oBrw:stabilize() + ENDDO nKey := Inkey( 0 ) - if( nKey == 27 .or. nKey == 13 ) - exit - elseif( nKey == -1 ) - s_lFixPos := iif(s_lFixPos, .F., .T.) - exit - elseif( nKey == 24 ) + IF nKey == 27 .OR. nKey == 13 + EXIT + ELSEIF nKey == -1 + s_lFixPos := iif( s_lFixPos, .F. , .T. ) + EXIT + ELSEIF nKey == 24 oBrw:Down() - elseif( nKey == 05 ) + ELSEIF nKey == 5 oBrw:Up() - elseif( nKey == 03 ) + ELSEIF nKey == 3 oBrw:pageDown() - elseif( nKey == 18 ) + ELSEIF nKey == 18 oBrw:pageUp() - elseif( nKey == 29 ).or.( nKey == 31 ) + ELSEIF nKey == 29 .OR. nKey == 31 oBrw:goTop() - elseif( nKey == 23 ).or.( nKey == 30 ) + ELSEIF nKey == 23 .OR. nKey == 30 oBrw:goBottom() - elseif( nKey == 01 ) + ELSEIF nKey == 1 oBrw:rowPos := 1 - elseif( nKey == 06 ) + ELSEIF nKey == 6 oBrw:rowPos := s_nLastRec - endif - enddo -return oBrw:rowPos -/***** -* END -******/ + ENDIF + ENDDO + + RETURN oBrw:rowPos diff --git a/harbour/tests/clasinit.prg b/harbour/tests/clasinit.prg index e093a03903..d261a89c63 100644 --- a/harbour/tests/clasinit.prg +++ b/harbour/tests/clasinit.prg @@ -40,7 +40,7 @@ FUNCTION TForm() oClass:AddMethod( "New", @New() ) // define this class objects methods oClass:AddMethod( "Show", @Show() ) oClass:AddInline( "CalcArea", ; - { |self| ( ::nRight - ::nLeft ) * ( ::nBottom - ::nTop ) } ) + {| self | ( ::nRight - ::nLeft ) * ( ::nBottom - ::nTop ) } ) oClass:Create() // builds this class ENDIF diff --git a/harbour/tests/clsicast.prg b/harbour/tests/clsicast.prg index 6281e55d5e..5a3c20b1e4 100644 --- a/harbour/tests/clsicast.prg +++ b/harbour/tests/clsicast.prg @@ -12,9 +12,8 @@ * */ -#define EOL chr(10) #xtranslate QQOUT([]) => [OUTSTD()] -#xtranslate QOUT([]) => OUTSTD(EOL)[;OUTSTD()] +#xtranslate QOUT([]) => OUTSTD(hb_eol())[;OUTSTD()] #include "hbclass.ch" diff --git a/harbour/tests/clsscast.prg b/harbour/tests/clsscast.prg index c4cf38ce50..fe80b0c748 100644 --- a/harbour/tests/clsscast.prg +++ b/harbour/tests/clsscast.prg @@ -12,9 +12,8 @@ * */ -#define EOL chr(10) #xtranslate QQOUT([]) => [OUTSTD()] -#xtranslate QOUT([]) => OUTSTD(EOL)[;OUTSTD()] +#xtranslate QOUT([]) => OUTSTD(hb_eol())[;OUTSTD()] #include "hbclass.ch" diff --git a/harbour/tests/clsscope.prg b/harbour/tests/clsscope.prg index a8119ba2c9..507425878f 100644 --- a/harbour/tests/clsscope.prg +++ b/harbour/tests/clsscope.prg @@ -11,10 +11,8 @@ * */ - -#define EOL chr(10) -#command ? => OUTSTD(EOL) -#xtranslate QOUT() => OUTSTD(EOL,) +#command ? => OUTSTD(hb_eol()) +#xtranslate QOUT() => OUTSTD(hb_eol(),) #include "hbclass.ch" diff --git a/harbour/tests/codebl.prg b/harbour/tests/codebl.prg index b422e64cca..66d4875839 100644 --- a/harbour/tests/codebl.prg +++ b/harbour/tests/codebl.prg @@ -2,7 +2,7 @@ * $Id$ */ -STATIC cbStatic +STATIC s_cbStatic PROCEDURE Main() @@ -29,12 +29,12 @@ PROCEDURE Main() QOut( "Test for indirect detaching of local variables" ) DetachToStatic( 1 ) - mqout( 2, Eval( cbStatic, 1 ) ) - mqout( 3, Eval( cbStatic, 2 ) ) - cb := cbStatic + mqout( 2, Eval( s_cbStatic, 1 ) ) + mqout( 3, Eval( s_cbStatic, 2 ) ) + cb := s_cbStatic DetachToStatic( 100 ) - mqout( 200, Eval( cbStatic, 100 ) ) - mqout( 300, Eval( cbStatic, 200 ) ) + mqout( 200, Eval( s_cbStatic, 100 ) ) + mqout( 300, Eval( s_cbStatic, 200 ) ) mqout( 4, Eval( cb, 3 ) ) ReferParam() @@ -62,8 +62,8 @@ PROCEDURE GetArray( a ) a := Array( 100 ) FOR i := 1 TO 100 IF ( i % 6 ) == 0 - a[ i-2 ] = NIL - a[ i-4 ] = NIL + a[ i - 2 ] = NIL + a[ i - 4 ] = NIL ENDIF a[ i ] := TestBlocks() NEXT @@ -75,7 +75,7 @@ PROCEDURE PrintArray( a ) LOCAL i FOR i := 1 TO 100 - IF a[i] != NIL + IF a[ i ] != NIL Eval( a[ i ][ 2 ], i ) mqout( i, Eval( a[ i ][ 1 ] ) ) ENDIF @@ -112,7 +112,7 @@ FUNCTION DoThing( n ) FUNCTION DetachToStatic( n ) - cbStatic = {| x | n + x } + s_cbStatic := {| x | n + x } RETURN NIL diff --git a/harbour/tests/codebloc.prg b/harbour/tests/codebloc.prg index 4c4d6751cb..629bc6ccb4 100644 --- a/harbour/tests/codebloc.prg +++ b/harbour/tests/codebloc.prg @@ -23,7 +23,7 @@ PROCEDURE Main() d = "with access to local variables" a = {| b, c | OutStd( "I am a second codeblock " + d + b + ; - IIF( c == NIL, ' empty second parameter ', c ) ), OutStd( hb_eol() ), "WITH return value" } + iif( c == NIL, ' empty second parameter ', c ) ), OutStd( hb_eol() ), "WITH return value" } Eval( a, ", codeblock parameters" ) OutStd( hb_eol() ) @@ -39,7 +39,7 @@ PROCEDURE Main() AnotherTest( a, "==> Another " ) OutStd( hb_eol() ) - a = {| c | IIF( c == NIL, {| a | "First " + a }, {| a | "Second " + a } ) } + a = {| c | iif( c == NIL, {| a | "First " + a }, {| a | "Second " + a } ) } a = Eval( a ) OutStd( hb_eol() ) OutStd( Eval( a, "codeblock created in a codeblock" ) ) diff --git a/harbour/tests/cpinfo.prg b/harbour/tests/cpinfo.prg index f66c8d3c48..95011b5b49 100644 --- a/harbour/tests/cpinfo.prg +++ b/harbour/tests/cpinfo.prg @@ -38,7 +38,7 @@ proc main( cdp, info, unicode ) for i := 1 to len( a ) a[ i ] := i - 1 next - asort( a,,, { |x,y| chr( x ) + chr( 0 ) < chr( y ) + chr( 0 ) } ) + asort( a,,, {| x, y | chr( x ) + chr( 0 ) < chr( y ) + chr( 0 ) } ) ? date(), time(), os(), version() #ifdef __HARBOUR__ @@ -402,7 +402,7 @@ static function genCP( id, info, unicode, lBin, lWarn, lMixed, cUp, cLo ) lower[ i ] := asc( lower( c ) ) tmp[ i ] := i - 1 next - asort( tmp,,, { |x,y| chr( x ) + chr( 0 ) < chr( y ) + chr( 0 ) } ) + asort( tmp,,, {| x, y | chr( x ) + chr( 0 ) < chr( y ) + chr( 0 ) } ) for i := 1 to 256 sort[ tmp[ i ] + 1 ] := i - 1 next diff --git a/harbour/tests/db_brows.prg b/harbour/tests/db_brows.prg index af70678f92..d77e51fe29 100644 --- a/harbour/tests/db_brows.prg +++ b/harbour/tests/db_brows.prg @@ -7,8 +7,6 @@ //+ //+ Written by Alexander Kresin //+ -//+ Date : 30/09/1999 -//+ Time : 19:20 //+ Placed in the public domain //+ //+ Source Module => db_brows.prg @@ -780,16 +778,16 @@ FUNCTION InitList LI_NSTR := LI_MSED := 1 LI_CLR := "W+/B" LI_CLRV := "R/W" - LI_BSKIP := { | a, x | HB_SYMBOL_UNUSED( a ), dbSkip( x ) } - LI_BGTOP := { || DBGOTOP() } - LI_BGBOT := { || dbGoBottom() } - LI_BEOF := { || Eof() } - LI_BBOF := { || Bof() } - LI_B1 := { | a | HB_SYMBOL_UNUSED( a ), DevPos( LI_Y2, LI_X1 + 2 ), DevOut( Str( RecNo(), 6 ) + "/" + Str( LI_KOLZ, 6 ) ) } + LI_BSKIP := {| a, x | HB_SYMBOL_UNUSED( a ), dbSkip( x ) } + LI_BGTOP := {|| DBGOTOP() } + LI_BGBOT := {|| dbGoBottom() } + LI_BEOF := {|| Eof() } + LI_BBOF := {|| Bof() } + LI_B1 := {| a | HB_SYMBOL_UNUSED( a ), DevPos( LI_Y2, LI_X1 + 2 ), DevOut( Str( RecNo(), 6 ) + "/" + Str( LI_KOLZ, 6 ) ) } LI_FREEZE := 0 - LI_RCOU := { || RecCount() } - LI_RECNO := { || RecNo() } - LI_BGOTO := { | a, n | HB_SYMBOL_UNUSED( a ), dbGoto( n ) } + LI_RCOU := {|| RecCount() } + LI_RECNO := {|| RecNo() } + LI_BGOTO := {| a, n | HB_SYMBOL_UNUSED( a ), dbGoto( n ) } LI_PRFLT := LI_LVIEW := .F. LI_LSOHR := .T. LI_BDESHIN := LI_BDESHOUT := LI_MSF := LI_MSTYP := LI_NAMES := Nil diff --git a/harbour/tests/destruct.prg b/harbour/tests/destruct.prg index 0f3a7b80cd..5d5fb68035 100644 --- a/harbour/tests/destruct.prg +++ b/harbour/tests/destruct.prg @@ -13,14 +13,15 @@ #include "hbclass.ch" -memvar P +MEMVAR P + +PROCEDURE Main() -PROC MAIN() LOCAL bError PUBLIC P := NIL - bError := errorBlock( { | oErr | myErrorHandler( oErr ) } ) + bError := ErrorBlock( {| oErr | myErrorHandler( oErr ) } ) ? "First simple tests when object is not destroyed by GC" ? "=====================================================" @@ -37,66 +38,78 @@ PROC MAIN() GCFREETEST( 2 ) GCFREETEST( 3 ) - errorBlock( bError ) + ErrorBlock( bError ) ? ? "*** END OF TEST ***" -return + RETURN STATIC PROCEDURE SIMPLETEST( type ) + LOCAL o ? - ? "=> o := myClass():new( " + ltrim( str( type ) ) + " )" + ? "=> o := myClass():new( " + hb_ntos( type ) + " )" o := myClass():new( type ) ? "=> o:className() ->", o:className() ? "=> o := NIL" - begin sequence + BEGIN SEQUENCE o := NIL end -RETURN + + RETURN STATIC PROCEDURE GCFREETEST( type ) + LOCAL o, a ? - ? "=> o := myClass():new( " + ltrim( str( type ) ) + " )" + ? "=> o := myClass():new( " + hb_ntos( type ) + " )" o := myClass():new( type ) ? "=> o:className() ->", o:className() - ? "=> create corss reference: a := { o, nil }; a[2] := a; a := NIL" - a := { o, nil }; a[2] := a; a := NIL + ? "=> create corss reference: a := { o, nil }; a[ 2 ] := a; a := NIL" + a := { o, nil }; a[ 2 ] := a; a := NIL ? "=> o := NIL" - begin sequence + BEGIN SEQUENCE o := NIL - end + END ? "=> hb_gcAll()" - begin sequence + BEGIN SEQUENCE hb_gcAll() - end -RETURN + END + + RETURN STATIC FUNCTION myErrorHandler( oErr ) - ? "Error ->", ltrim( str( oErr:gencode ) ), ; - oErr:description + ":", oErr:operation - BREAK oErr -RETURN NIL + ? "Error ->", hb_ntos( oErr:gencode ), ; + oErr:description + ":", oErr:operation + BREAK oErr + + RETURN NIL CREATE CLASS myClass - VAR type + + VAR TYPE VAR var1 + CLASS VAR var2 + METHOD init DESTRUCTOR dtor + END CLASS METHOD INIT( type ) CLASS myClass + ? "Hi, I'm INIT method of class:", self:classname() ::type := type -RETURN self + + RETURN self PROCEDURE DTOR CLASS myClass + ? " Hi, I'm desturctor of class: ", self:classname() IF ::type == 1 @@ -116,4 +129,4 @@ PROCEDURE DTOR CLASS myClass ? " It's a safe destructor." ENDIF -RETURN + RETURN diff --git a/harbour/tests/dynobj.prg b/harbour/tests/dynobj.prg index de15a52043..7771301410 100644 --- a/harbour/tests/dynobj.prg +++ b/harbour/tests/dynobj.prg @@ -7,8 +7,6 @@ // // Implementation of dynamic objects in Harbour // -// Date : 1999/05/12 -// // Written by Eddie Runia // www - http://harbour-project.org // diff --git a/harbour/tests/flink.prg b/harbour/tests/flink.prg index d85c2312a3..80d189eeef 100644 --- a/harbour/tests/flink.prg +++ b/harbour/tests/flink.prg @@ -16,38 +16,38 @@ PROCEDURE Main() hb_MemoWrit( "_hb_h.tmp", ">h.tmp<" ) - ? HB_FLINK() - ? FERROR() + ? hb_FLink() + ? FError() - ? HB_FLINKREAD() - ? FERROR() + ? hb_FLinkRead() + ? FError() - ? HB_FLINKREAD( "_hb_h.tmp" ) - ? FERROR() + ? hb_FLinkRead( "_hb_h.tmp" ) + ? FError() - ? HB_FLINK( "_hb_h.tmp", "_hb_hlnk.tmp" ) - ? FERROR() + ? hb_FLink( "_hb_h.tmp", "_hb_hlnk.tmp" ) + ? FError() hb_MemoWrit( "_hb_s.tmp", ">s.tmp<" ) /* Requires special rights on Windows system, by default Administrators are allowed. */ - ? HB_FLINKSYM() - ? FERROR() + ? hb_FLinkSym() + ? FError() - ? HB_FLINKSYM( "_hb_s.tmp", "_hb_slnk.tmp" ) - ? FERROR() + ? hb_FLinkSym( "_hb_s.tmp", "_hb_slnk.tmp" ) + ? FError() - ? HB_FLINKREAD( "_hb_slnk.tmp" ) - ? FERROR() + ? hb_FLinkRead( "_hb_slnk.tmp" ) + ? FError() hb_DirCreate( "_hb_d" ) - ? HB_FLINKSYM( "_hb_d", "_hb_dlnk" ) - ? FERROR() + ? hb_FLinkSym( "_hb_d", "_hb_dlnk" ) + ? FError() - ? HB_FLINKREAD( "_hb_dlnk" ) - ? FERROR() + ? hb_FLinkRead( "_hb_dlnk" ) + ? FError() RETURN diff --git a/harbour/tests/fortest.prg b/harbour/tests/fortest.prg index fe4038d617..e46b8a3234 100644 --- a/harbour/tests/fortest.prg +++ b/harbour/tests/fortest.prg @@ -20,27 +20,28 @@ PROCEDURE Main() QOut( "Testing Harbour For Next loops." ) - array := { { 1, 10, 1 }, ; - { 10, 1, - 1 }, ; - { 1, 10, - 1 }, ; + 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 }, ; + { 1, 10, -4 }, ; { 10, 1, 4 } } FOR tmp := 1 TO Len( array ) - snFrom := array[tmp][1] - snTo := array[tmp][2] - snStep := array[tmp][3] + snFrom := array[ tmp ][ 1 ] + snTo := array[ tmp ][ 2 ] + snStep := array[ tmp ][ 3 ] - OutStd( "From: " ) ; OutStd( snFrom ) + OutStd( " From: " ) ; OutStd( snFrom ) OutStd( " To: " ) ; OutStd( snTo ) OutStd( " Step: " ) ; OutStd( snStep ) OutStd( Chr( 13 ) + Chr( 10 ) ) - FOR n := Eval( { || ValFrom() } ) TO Eval( { || ValTo() } ) STEP Eval( { || ValStep() } ) + FOR n := Eval( {|| ValFrom() } ) TO Eval( {|| ValTo() } ) STEP Eval( {|| ValStep() } ) OutStd( "Exec " ) ; OutStd( n ) ; OutStd( Chr( 13 ) + Chr( 10 ) ) NEXT n diff --git a/harbour/tests/fsplit.prg b/harbour/tests/fsplit.prg index deb9248ef9..b6e033a092 100644 --- a/harbour/tests/fsplit.prg +++ b/harbour/tests/fsplit.prg @@ -10,7 +10,7 @@ PROCEDURE Main( cSource, cSplit, nByte ) RETURN -FUNCTION fsplit ( csource, csplit, nbyte ) +FUNCTION fsplit( csource, csplit, nbyte ) LOCAL i // general counter LOCAL ccommand := "" // dos command for joining files diff --git a/harbour/tests/inherit.prg b/harbour/tests/inherit.prg index 0a980c3fcf..a769712326 100644 --- a/harbour/tests/inherit.prg +++ b/harbour/tests/inherit.prg @@ -4,13 +4,9 @@ #include "set.ch" -// -// Inherit // // Test of inheritance // -// Date : 30/05/1999 -// /* * Written by Eddie Runia @@ -71,10 +67,10 @@ FUNCTION TEmpty() IF oEmpty == NIL oEmpty := HBClass():New( "TEmpty" ) // Create a new class def - oEmpty:AddInline( "New", { |self|self } ) + oEmpty:AddInline( "New", {| self |self } ) - oEmpty:AddInline( "Run", { ||QOut( "Run !" ) } ) // Test command - oEmpty:AddInline( "Set", { |self, xParam|::Out := xParam } ) + oEmpty:AddInline( "Run", {|| QOut( "Run !" ) } ) // Test command + oEmpty:AddInline( "Set", {| self, xParam | ::Out := xParam } ) oEmpty:AddData( "Out", "Hi there" ) // Test command oEmpty:AddVirtual( "Dispose" ) // Clean up code @@ -93,7 +89,7 @@ FUNCTION TOnTop() IF oOnTop == NIL oOnTop := HBClass():New( "TOnTop", "TTextFile" ) - oOnTop:AddInline( "Say", { |self, cArg| QOut( __objSendMsg(self, cArg ) ) } ) + oOnTop:AddInline( "Say", {| self, cArg | QOut( __objSendMsg( self, cArg ) ) } ) oOnTop:Create() ENDIF diff --git a/harbour/tests/keywords.prg b/harbour/tests/keywords.prg index 241b986d9d..c8fccbabaa 100644 --- a/harbour/tests/keywords.prg +++ b/harbour/tests/keywords.prg @@ -212,7 +212,7 @@ begin sequence break->break :=break->break +break->break BREAK break :=break[ 2 ] //not allowed in Clipper - bReak :=IIF( bReak==1, BREAK(0), BREAK(bReak) ) + bReak :=iif( bReak==1, BREAK(0), BREAK(bReak) ) recover USING bReak BREAK( Break( break(0) ) ) end diff --git a/harbour/tests/multiarg.prg b/harbour/tests/multiarg.prg index b14e7e3118..49da1baa4d 100644 --- a/harbour/tests/multiarg.prg +++ b/harbour/tests/multiarg.prg @@ -4,8 +4,6 @@ // Testing of multiple arguments // -// Date : 1999/05/24 -// // Written by Eddie Runia // www - http://harbour-project.org // diff --git a/harbour/tests/newrdd.prg b/harbour/tests/newrdd.prg index 109a5015e4..cb8ddd0b0a 100644 --- a/harbour/tests/newrdd.prg +++ b/harbour/tests/newrdd.prg @@ -198,12 +198,12 @@ PROCEDURE Main() Inkey( 0 ) CLS - ? "TESTDBF->( dbEval( { || QOut( TESTDBF->FIRST, TESTDBF->AGE ) }, ;" - ? " { || TESTDBF->AGE == 23 } ) )" + ? "TESTDBF->( dbEval( {|| QOut( TESTDBF->FIRST, TESTDBF->AGE ) }, ;" + ? " {|| TESTDBF->AGE == 23 } ) )" ? "" ? "dbCommit()" - TESTDBF->( dbEval( { || QOut( TESTDBF->FIRST, TESTDBF->AGE ) }, ; - { || TESTDBF->AGE == 23 } ) ) + TESTDBF->( dbEval( {|| QOut( TESTDBF->FIRST, TESTDBF->AGE ) }, ; + {|| TESTDBF->AGE == 23 } ) ) TESTDBF->( dbCommit() ) ? "Press any key to continue..." @@ -304,7 +304,7 @@ PROCEDURE Main() ? 'NEWRDD->( dbCloseArea() )' ? 'dbUseArea( .T., "DBF", "newrdd", "NEWRDD", .F., .F. )' ? 'nI := 1' - ? 'NEWRDD->( __dbPack( { || QOut( nI ), nI++ } ) )' + ? 'NEWRDD->( __dbPack( {|| QOut( nI ), nI++ } ) )' ? '? "RecCount:", NEWRDD->( RecCount() )' ? "" NEWRDD->( dbCloseArea() ) @@ -315,7 +315,7 @@ PROCEDURE Main() CLS nI := 1 - NEWRDD->( __dbPack( { || QOut( nI ), nI ++ } ) ) + NEWRDD->( __dbPack( {|| QOut( nI ), nI ++ } ) ) ? "RecCount:", NEWRDD->( RecCount() ) ? "Press any key to continue..." diff --git a/harbour/tests/onidle.prg b/harbour/tests/onidle.prg index 00d7113140..4c2de12a28 100644 --- a/harbour/tests/onidle.prg +++ b/harbour/tests/onidle.prg @@ -22,10 +22,10 @@ PROCEDURE Main() @ 11, 2 SAY "Memory after TEST() and before collecting" + Str( Memory( HB_MEM_USED ) ) hb_gcAll() @ 12, 2 SAY "Memory after collecting" + Str( Memory( HB_MEM_USED ) ) - nH1 := hb_idleAdd( { || DevPos( 0,01 ), DevOut( Time() ) } ) - nH2 := hb_idleAdd( { || DevPos( 0,21 ), TEST(), DevOut( Memory(HB_MEM_USED ) ) } ) - nH3 := hb_idleAdd( { || DevPos( 0,41 ), IIF( n == 4,n := 1,n ++ ), DevOut( aSign[n] ) } ) - nH4 := hb_idleAdd( { || DevPos( 0,61 ), DevOut( 1000 * (Seconds() - nPrev ) ), nPrev := Seconds() } ) + nH1 := hb_idleAdd( {|| DevPos( 0,01 ), DevOut( Time() ) } ) + nH2 := hb_idleAdd( {|| DevPos( 0,21 ), TEST(), DevOut( Memory(HB_MEM_USED ) ) } ) + nH3 := hb_idleAdd( {|| DevPos( 0,41 ), iif( n == 4,n := 1,n ++ ), DevOut( aSign[n] ) } ) + nH4 := hb_idleAdd( {|| DevPos( 0,61 ), DevOut( 1000 * (Seconds() - nPrev ) ), nPrev := Seconds() } ) ? ValType( nH1 ), nH1, ValType( nH2 ), nH2, ValType( nH3 ), nH3, ValType( nH4 ), nH4 diff --git a/harbour/tests/overload.prg b/harbour/tests/overload.prg index 2a48397475..43840ba18c 100644 --- a/harbour/tests/overload.prg +++ b/harbour/tests/overload.prg @@ -2,18 +2,12 @@ * $Id$ */ -// -// DynObj // // Implementation of operator overload in Harbour // -// Date : 1999/05/15 -// // Written by Eddie Runia // www - http://harbour-project.org // -// Jfl 2001/11/18 command mode added -// // Placed in the public domain // @@ -41,8 +35,8 @@ PROCEDURE Main() QOut( "Greater than or Equal:", oString >= "Hello" ) QOut( "Concatenation + :", oString + "Hello" ) QOut( "Concatenation - :", oString - "Hello" ) - QOut( "Array index[2] :", oString[2] ) - QOut( "Array index[3] := 'X' :", oString[3] := 'X' ) + QOut( "Array index[2] :", oString[ 2 ] ) + QOut( "Array index[3] := 'X' :", oString[ 3 ] := 'X' ) QOut( oString:cValue ) RETURN nil @@ -69,13 +63,13 @@ CREATE CLASS tString ENDCLASS - /* -function TString() - static oClass +FUNCTION TString() - if oClass == nil + STATIC oClass + + IF oClass == nil oClass = HBClass():New( "TSTRING" ) // starts a new class definition oClass:AddData( "cValue" ) // define this class objects datas @@ -92,19 +86,19 @@ function TString() oClass:AddInline( "-" , {| self, cTest | ::cValue - cTest } ) oClass:AddInline( "$" , {| self, cTest | ::cValue $ cTest } ) - oClass:AddInline( "HasMsg", {| self, cMsg | __ObjHasMsg( QSelf(), cMsg ) } ) + oClass:AddInline( "HasMsg", {| self, cMsg | __objHasMsg( QSelf(), cMsg ) } ) oClass:Create() // builds this class - endif + ENDIF -return oClass:Instance() // builds an object of this class + RETURN oClass:Instance() // builds an object of this class -static function New( cText ) +STATIC FUNCTION New( cText ) - local Self := QSelf() + LOCAL Self := QSelf() ::cValue := cText -return Self + RETURN Self */ diff --git a/harbour/tests/rto_get.prg b/harbour/tests/rto_get.prg index f9a62702cc..97cbca7451 100644 --- a/harbour/tests/rto_get.prg +++ b/harbour/tests/rto_get.prg @@ -129,7 +129,7 @@ PROCEDURE Main( cArg01, cArg02, cArg03, cArg04 ) Set( _SET_DELIMITERS, .T. ) Set( _SET_DELIMCHARS, "<>" ) - o := GetNew( 14, 16, { | x | iif( x == NIL, cStr01, cStr01 := x ) }, "cStr01",, "W+/N,BG/N" ) + o := GetNew( 14, 16, {| x | iif( x == NIL, cStr01, cStr01 := x ) }, "cStr01",, "W+/N,BG/N" ) TEST_LINE( o:display() ) Set( _SET_DELIMCHARS, "()" ) TEST_LINE( o:display() ) diff --git a/harbour/tests/setkeys.prg b/harbour/tests/setkeys.prg index 4cdf66951e..4ffe1a31e9 100644 --- a/harbour/tests/setkeys.prg +++ b/harbour/tests/setkeys.prg @@ -85,12 +85,12 @@ PROCEDURE Main() #endif - SetKey( K_F10, { || Alert( Transform( GetActive():varGet(), NIL ) ) }, ; - { || !Empty( GetActive():VarGet() ) } ) /* :buffer */ - SetKey( K_F9 , { || k := hb_SetKeySave( NIL ), ; - SetKey( K_F9, { || hb_SetKeySave( k ) } ) } ) - SetKey( K_F8 , { || SubMain() }, { || F8Active } ) - SetKey( K_F7 , { || F8Active := ! F8Active } ) + SetKey( K_F10, {|| Alert( Transform( GetActive():varGet(), NIL ) ) }, ; + {|| !Empty( GetActive():VarGet() ) } ) /* :buffer */ + SetKey( K_F9 , {|| k := hb_SetKeySave( NIL ), ; + SetKey( K_F9, {|| hb_SetKeySave( k ) } ) } ) + SetKey( K_F8 , {|| SubMain() }, {|| F8Active } ) + SetKey( K_F7 , {|| F8Active := ! F8Active } ) READ ? alpha, bravo, charlie @@ -105,7 +105,7 @@ STATIC PROCEDURE SubMain() bF8Action := hb_SetKeyGet( K_F8, @bF8Active ) SetKey( K_F8, NIL ) - hb_SetKeyArray( { 49, 50, 52, 53 }, { |x| QOut( Chr( x ) ) } ) + hb_SetKeyArray( { 49, 50, 52, 53 }, {| x | QOut( Chr( x ) ) } ) DO WHILE ( n := Inkey( 0 ) ) != K_ESC IF hb_SetKeyCheck( n, ProcName(), ProcLine(), ReadVar() ) QQOut( " hit hot" ) diff --git a/harbour/tests/speedtst.prg b/harbour/tests/speedtst.prg index df00974f9b..17232f9354 100644 --- a/harbour/tests/speedtst.prg +++ b/harbour/tests/speedtst.prg @@ -343,31 +343,31 @@ TEST t021 WITH a := afill( array( ARR_LEN ), ; TEST t022 WITH d := date() CODE dtos( d - i % 10000 ) -TEST t023 CODE eval( { || i % ARR_LEN } ) +TEST t023 CODE eval( {|| i % ARR_LEN } ) -TEST t024 WITH bc := { || i % ARR_LEN } ; - INFO eval( bc := { || i % ARR_LEN } ) ; +TEST t024 WITH bc := {|| i % ARR_LEN } ; + INFO eval( bc := {|| i % ARR_LEN } ) ; CODE eval( bc ) -TEST t025 CODE eval( { |x| x % ARR_LEN }, i ) +TEST t025 CODE eval( {| x | x % ARR_LEN }, i ) -TEST t026 WITH bc := { |x| x % ARR_LEN } ; - INFO eval( bc := { |x| x % ARR_LEN }, i ) ; +TEST t026 WITH bc := {| x | x % ARR_LEN } ; + INFO eval( bc := {| x | x % ARR_LEN }, i ) ; CODE eval( bc, i ) -TEST t027 CODE eval( { |x| f1( x ) }, i ) +TEST t027 CODE eval( {| x | f1( x ) }, i ) -TEST t028 WITH bc := { |x| f1( x ) } ; - INFO eval( bc := { |x| f1( x ) }, i ) ; +TEST t028 WITH bc := {| x | f1( x ) } ; + INFO eval( bc := {| x | f1( x ) }, i ) ; CODE eval( bc, i ) -TEST t029 WITH bc := mkBlock( "{ |x| f1( x ) }" ) ; - INFO eval( bc := &("{ |x| f1( x ) }"), i ) ; +TEST t029 WITH bc := mkBlock( "{| x | f1( x ) }" ) ; + INFO eval( bc := &("{| x | f1( x ) }"), i ) ; CODE eval( bc, i ) TEST t030 CODE x := &( 'f1(' + str(i) + ')' ) -TEST t031 WITH bc CODE bc := &( '{|x|f1(x)}' ), eval( bc, i ) +TEST t031 WITH bc CODE bc := &( '{| x |f1(x)}' ), eval( bc, i ) TEST t032 CODE x := valtype( x ) + valtype( i ) @@ -376,38 +376,38 @@ TEST t033 WITH a := afill( array( ARR_LEN ), ; CODE x := strzero( i % 100, 2 ) $ a[ i % ARR_LEN + 1 ] TEST t034 WITH a := array( ARR_LEN ), s := dtos( date() ) ; - INIT aeval( a, { |x,i| a[i] := left( s + s, i ), x } ) ; + INIT aeval( a, {| x, i | a[i] := left( s + s, i ), x } ) ; CODE x := a[ i % ARR_LEN + 1 ] == s TEST t035 WITH a := array( ARR_LEN ), s := dtos( date() ) ; - INIT aeval( a, { |x,i| a[i] := left( s + s, i ), x } ) ; + INIT aeval( a, {| x, i | a[i] := left( s + s, i ), x } ) ; CODE x := a[ i % ARR_LEN + 1 ] = s TEST t036 WITH a := array( ARR_LEN ), s := dtos( date() ) ; - INIT aeval( a, { |x,i| a[i] := left( s + s, i ), x } ) ; + INIT aeval( a, {| x, i | a[i] := left( s + s, i ), x } ) ; CODE x := a[ i % ARR_LEN + 1 ] >= s TEST t037 WITH a := array( ARR_LEN ), s := dtos( date() ) ; - INIT aeval( a, { |x,i| a[i] := left( s + s, i ), x } ) ; + INIT aeval( a, {| x, i | a[i] := left( s + s, i ), x } ) ; CODE x := a[ i % ARR_LEN + 1 ] <= s TEST t038 WITH a := array( ARR_LEN ), s := dtos( date() ) ; - INIT aeval( a, { |x,i| a[i] := left( s + s, i ), x } ) ; + INIT aeval( a, {| x, i | a[i] := left( s + s, i ), x } ) ; CODE x := a[ i % ARR_LEN + 1 ] < s TEST t039 WITH a := array( ARR_LEN ), s := dtos( date() ) ; - INIT aeval( a, { |x,i| a[i] := left( s + s, i ), x } ) ; + INIT aeval( a, {| x, i | a[i] := left( s + s, i ), x } ) ; CODE x := a[ i % ARR_LEN + 1 ] > s TEST t040 WITH a := array( ARR_LEN ) ; - INIT aeval( a, { |x,i| a[i] := i, x } ) ; + INIT aeval( a, {| x, i | a[i] := i, x } ) ; CODE ascan( a, i % ARR_LEN ) TEST t041 WITH a := array( ARR_LEN ) ; - INIT aeval( a, { |x,i| a[i] := i, x } ) ; - CODE ascan( a, { |x| x == i % ARR_LEN } ) + INIT aeval( a, {| x, i | a[i] := i, x } ) ; + CODE ascan( a, {| x | x == i % ARR_LEN } ) -TEST t042 WITH a := {}, a2 := { 1, 2, 3 }, bc := { |x| f1(x) }, ; +TEST t042 WITH a := {}, a2 := { 1, 2, 3 }, bc := {| x | f1(x) }, ; s := dtos( date() ), s2 := "static text" ; CODE iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.t.,s,s2,a2,bc}) @@ -435,7 +435,7 @@ TEST t050 WITH c := repl( dtos( date() ),5000 ), c2 ; INFO "f2( @c[1...40000] ), c2 := c" ; CODE f2( @c ), c2 := c -TEST t051 WITH a := {}, a2 := { 1, 2, 3 }, bc := { |x| f1(x) }, ; +TEST t051 WITH a := {}, a2 := { 1, 2, 3 }, bc := {| x | f1(x) }, ; s := dtos( date() ), s2 := "static text", n := 1.23 ; CODE f3( a, a2, s, i, s2, bc, i, n, x ) diff --git a/harbour/tests/stripem.prg b/harbour/tests/stripem.prg index 66d304ca6d..e1185d0d90 100644 --- a/harbour/tests/stripem.prg +++ b/harbour/tests/stripem.prg @@ -6,13 +6,9 @@ #xtranslate Default( , ) => iif( == NIL, , ) -// -// Strip // // The Harbour stripping command // -// Date : 04/05/1999 -// // Usage : Strip( FileFrom, FileTo ) // // The output from FileFrom is copied to FileTo except for the empty lines @@ -84,10 +80,10 @@ FUNCTION TTextFile() // Parameter = dirty oFile:AddMethod( "Goto" , @Goto() ) // Go to line oFile:AddInline( "Run" , ; // Get/set data - { |self, xTxt, lCRLF|iif( ::cMode == "R", ::Read(), ::WriteLn( xTxt, lCRLF ) ) } ) - oFile:AddInline( "Write" , { |self, xTxt|::WriteLn( xTxt, .F. ) } ) + {| self, xTxt, lCRLF | iif( ::cMode == "R", ::Read(), ::WriteLn( xTxt, lCRLF ) ) } ) + oFile:AddInline( "Write" , {| self, xTxt | ::WriteLn( xTxt, .F. ) } ) // Write without CR - oFile:AddInline( "EoF" , { |self|::lEoF } ) + oFile:AddInline( "EoF" , {| self | ::lEoF } ) // End of file as function oFile:Create() ENDIF @@ -282,7 +278,7 @@ FUNCTION ToChar( xVal ) RETURN DToC( xVal ) CASE cType == 'L' - RETURN IIF( xVal, ".T.", ".F." ) + RETURN iif( xVal, ".T.", ".F." ) CASE cType == 'M' RETURN xVal diff --git a/harbour/tests/tb1.prg b/harbour/tests/tb1.prg index 7a21f8d059..ca5aeabc4d 100644 --- a/harbour/tests/tb1.prg +++ b/harbour/tests/tb1.prg @@ -16,16 +16,16 @@ #include "setcurs.ch" #include "box.ch" -procedure Main() +PROCEDURE Main() - static s_nCount := 0 - static s_nPos := 1 - static s_nSize := 100 + STATIC s_nCount := 0 + STATIC s_nPos := 1 + STATIC s_nSize := 100 - local nTop, nLeft, nBottom, nRight - local cColor - local oBrw, oCol1, oCol2, oCol3, oCol4 - local nKey, nCol + LOCAL nTop, nLeft, nBottom, nRight + LOCAL cColor + LOCAL oBrw, oCol1, oCol2, oCol3, oCol4 + LOCAL nKey, nCol nTop := 2 nLeft := 10 @@ -33,46 +33,46 @@ procedure Main() nRight := 70 cColor := "W+/R,G+/BR,RG+/B,BG+/G,N/GR,GR+/BG,B/GR*" - set date format to "yyyy/mm/dd" + SET DATE FORMAT TO "yyyy/mm/dd" // enable mouse events in CL53/Harbour - #ifdef _SET_EVENTMASK - set( _SET_EVENTMASK, INKEY_ALL ) - mSetCursor( .t. ) - #endif +#ifdef _SET_EVENTMASK + SET( _SET_EVENTMASK, INKEY_ALL ) + MSetCursor( .T. ) +#endif - cls - dispBox( nTop, nLeft, nBottom, nRight, B_DOUBLE_SINGLE, cColor ) - oBrw := tbrowseNew( nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 ) - dispOutAt( nTop + 3, nLeft, "Ã", cColor ) - dispOutAt( nTop + 3, nRight, "´", cColor ) - dispOutAt( nBottom - 2, nLeft, "Ã", cColor ) - dispOutAt( nBottom - 2, nRight, "´", cColor ) + CLS + DispBox( nTop, nLeft, nBottom, nRight, B_DOUBLE_SINGLE, cColor ) + oBrw := TBRowseNew( nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 ) + DispOutAt( nTop + 3, nLeft, "Ã", cColor ) + DispOutAt( nTop + 3, nRight, "´", cColor ) + DispOutAt( nBottom - 2, nLeft, "Ã", cColor ) + DispOutAt( nBottom - 2, nRight, "´", cColor ) oBrw:colorSpec( cColor ) oBrw:headSep := "¿ ÚÄ" oBrw:footSep := "Ù ÀÄ" oBrw:colSep := "³ ³" - oBrw:SkipBlock := { | n | hb_idleSleep( 0.2 ), ; - n := iif( n < 0, max( n, 1 - s_nPos ), ; - min( s_nSize - s_nPos, n ) ), ; - s_nPos += n, n } - oBrw:GoTopBlock := { || s_nPos := 1 } - oBrw:GoBottomBlock := { || s_nPos := s_nSize } + oBrw:SkipBlock := {| n | hb_idleSleep( 0.2 ), ; + n := iif( n < 0, Max( n, 1 - s_nPos ), ; + Min( s_nSize - s_nPos, n ) ), ; + s_nPos += n, n } + oBrw:GoTopBlock := {|| s_nPos := 1 } + oBrw:GoBottomBlock := {|| s_nPos := s_nSize } - oCol1 := tbColumnNew( "COL;1;", {|| s_nPos } ) + oCol1 := TBColumnNew( "COL;1;", {|| s_nPos } ) oCol1:defColor := { 2, 1, 3, 4 } oCol1:footing := "position" - oCol1:colorBlock := {|val| { val % 5 + 1, val % 3 + 2 } } + oCol1:colorBlock := {| val | { val % 5 + 1, val % 3 + 2 } } - oCol2 := tbColumnNew( "COL;2", {|| s_nCount++ } ) + oCol2 := TBColumnNew( "COL;2", {|| s_nCount ++ } ) oCol2:defColor := { 3, 4, 5, 6 } oCol2:footing := "counter" oCol2:headSep := "¿ ÚÄ´HIDEÃÄ" - oCol3 := tbColumnNew( "COL 3", {|| s_nPos % 3 == 0 } ) + oCol3 := TBColumnNew( "COL 3", {|| s_nPos % 3 == 0 } ) oCol3:defColor := { 5, 6, 2, 3 } oCol3:footing := "logical" oCol3:picture := "@YR [Y]" // Clipper wrongly calculate the size here @@ -80,7 +80,7 @@ procedure Main() oCol3:footSep := "½ ÓÄ" oCol3:colSep := "º º" - oCol4 := tbColumnNew( " SHOW; ALL", {|| date() - s_nPos} ) + oCol4 := TBColumnNew( " SHOW; ALL", {|| Date() - s_nPos } ) oCol4:defColor := { 6, 3, 4, 2 } oCol4:footing := "date" @@ -92,44 +92,48 @@ procedure Main() // start at bottom oBrw:goBottom() - while .T. - while !oBrw:stabilize() .and. nextkey()==0 - enddo - nKey := inkey( 0 ) - if nKey == K_ESC - exit - elseif nKey == K_INS + WHILE .T. + WHILE !oBrw:stabilize() .AND. NextKey() == 0 + ENDDO + nKey := Inkey( 0 ) + IF nKey == K_ESC + EXIT + ELSEIF nKey == K_INS oBrw:colorRect( { oBrw:rowPos, 1, oBrw:rowPos, 4 }, { 7, 6 } ) - elseif nKey == K_DEL + ELSEIF nKey == K_DEL oBrw:refreshCurrent() - elseif nKey >= ASC( "0" ) .AND. nKey <= ASC( "3" ) - oBrw:freeze := nKey - ASC( "0" ) - elseif nKey == K_LBUTTONDOWN .and. ; - oBrw:hitTest(mRow(),mCol()) == HTHEADSEP .and. ; - ( ( nCol := oBrw:mColPos ) == 2 .or. nCol == 3 ) - if nCol == 2 + ELSEIF nKey >= Asc( "0" ) .AND. nKey <= Asc( "3" ) + oBrw:freeze := nKey - Asc( "0" ) + ELSEIF nKey == K_LBUTTONDOWN .AND. ; + oBrw:HitTest( MRow(), MCol() ) == HTHEADSEP .AND. ; + ( ( nCol := oBrw:mColPos ) == 2 .OR. nCol == 3 ) + IF nCol == 2 oCol2:width := 0 - else + ELSE oCol3:width := 0 - endif + ENDIF oBrw:configure() - elseif nKey == K_LBUTTONDOWN .and. ; - oBrw:hitTest(mRow(),mCol()) == HTHEADING .and. ; - oBrw:mColPos == 4 + ELSEIF nKey == K_LBUTTONDOWN .AND. ; + oBrw:HitTest( MRow(), MCol() ) == HTHEADING .AND. ; + oBrw:mColPos == 4 oCol2:width := 10 oCol3:width := 7 oBrw:configure() - else + ELSE oBrw:applyKey( nKey ) - endif - enddo + ENDIF + ENDDO -return + RETURN #ifndef __HARBOUR__ -proc hb_idleSleep( n ) - n += seconds() - while seconds() < n - enddo -return + +PROCEDURE hb_idleSleep( n ) + + n += Seconds() + WHILE Seconds() < n + ENDDO + + RETURN + #endif diff --git a/harbour/tests/testbrw.prg b/harbour/tests/testbrw.prg index 201bd4f920..7980772e16 100644 --- a/harbour/tests/testbrw.prg +++ b/harbour/tests/testbrw.prg @@ -25,17 +25,17 @@ PROCEDURE Main() oBrowse:ColSep := "³" oBrowse:HeadSep := "ÑÍ" oBrowse:FootSep := "ÏÍ" - oBrowse:GoTopBlock := { || n := 1 } - oBrowse:GoBottomBlock := { || n := Len( aTest0 ) } - oBrowse:SkipBlock := { | nSkip, nPos | nPos := n, ; + oBrowse:GoTopBlock := {|| n := 1 } + oBrowse:GoBottomBlock := {|| n := Len( aTest0 ) } + oBrowse:SkipBlock := {| nSkip, nPos | nPos := n, ; n := iif( nSkip > 0, Min( Len( aTest0 ), n + nSkip ), ; Max( 1, n + nSkip ) ), n - nPos } - oBrowse:AddColumn( TBColumnNew( "First", { || n } ) ) - oBrowse:AddColumn( TBColumnNew( "Second", { || aTest0[ n ] } ) ) - oBrowse:AddColumn( TBColumnNew( "Third", { || aTest1[ n ] } ) ) - oBrowse:AddColumn( TBColumnNew( "Forth", { || aTest2[ n ] } ) ) - oBrowse:AddColumn( TBColumnNew( "Fifth", { || aTest3[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "First", {|| n } ) ) + oBrowse:AddColumn( TBColumnNew( "Second", {|| aTest0[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "Third", {|| aTest1[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "Forth", {|| aTest2[ n ] } ) ) + oBrowse:AddColumn( TBColumnNew( "Fifth", {|| aTest3[ n ] } ) ) oBrowse:GetColumn( 1 ):Footing := 'Number' oBrowse:GetColumn( 2 ):Footing := 'Strins' diff --git a/harbour/tests/testdbf.prg b/harbour/tests/testdbf.prg index 5f495f0e9b..ed6ecd69c3 100644 --- a/harbour/tests/testdbf.prg +++ b/harbour/tests/testdbf.prg @@ -116,7 +116,7 @@ PROCEDURE Main() ? "Press any key..." Inkey( 0 ) - MYALIAS->( dbSetFilter( { || MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8 }, ; + MYALIAS->( dbSetFilter( {|| MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8 }, ; "MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8" ) ) MYALIAS->( dbGoTop() ) DO WHILE !MYALIAS->( EOF() ) @@ -131,7 +131,7 @@ PROCEDURE Main() ? "Press any key..." Inkey( 0 ) - MYALIAS->( dbSetFilter( { || MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8 }, ; + MYALIAS->( dbSetFilter( {|| MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8 }, ; "MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8" ) ) MYALIAS->( dbGoTop() ) DO WHILE !MYALIAS->( EOF() ) diff --git a/harbour/tests/testhtml.prg b/harbour/tests/testhtml.prg index 10713ef125..aa31ecf313 100644 --- a/harbour/tests/testhtml.prg +++ b/harbour/tests/testhtml.prg @@ -7,8 +7,6 @@ * testhtml.prg * Harbour Test of a HTML-Generator class. * -* 1999/05/30 First implementation. -* * Tips: - Use ShowResults to make dynamic html (to test dynamic * results, put the exe file on CGI-BIN dir or equivalent); * - Use SaveToFile to make static html page diff --git a/harbour/tests/testwarn.prg b/harbour/tests/testwarn.prg index df7166ee2d..d348cebe87 100644 --- a/harbour/tests/testwarn.prg +++ b/harbour/tests/testwarn.prg @@ -151,7 +151,7 @@ FUNCTION Test() FUNCTION Main2() Local n As Numeric, lVar AS LOGICAL - n := IIF( lVar, 'A', 3 ) //IIF() needs to be completed. + n := iif( lVar, 'A', 3 ) // iif() needs to be completed. n := 2 n := 'a' n := Seconds() + 2 @@ -193,7 +193,7 @@ FUNCTION Main3() n := a - IIF( n, 2, 3 ) + iif( n, 2, 3 ) RETURN NIL diff --git a/harbour/tests/tstblock.prg b/harbour/tests/tstblock.prg index 73c416b658..0f82e3697f 100644 --- a/harbour/tests/tstblock.prg +++ b/harbour/tests/tstblock.prg @@ -17,7 +17,7 @@ PROCEDURE Main() FOR i := 1 TO 3 M->Macro := "Var" + Str( i, 1 ) - bBlock[ i ] := { || &Macro } + bBlock[ i ] := {|| &Macro } NEXT ? "Early (Simple):" @@ -28,7 +28,7 @@ PROCEDURE Main() FOR i := 1 TO 3 M->Macro := "Var" + Str( i, 1 ) - bBlock[ i ] := { || &Macro + "!" } + bBlock[ i ] := {|| &Macro + "!" } NEXT ? @@ -40,7 +40,7 @@ PROCEDURE Main() FOR i := 1 TO 3 M->Macro := "Var" + Str( i, 1 ) - bBlock[ i ] := { || &( Macro ) } + bBlock[ i ] := {|| &( Macro ) } NEXT ? diff --git a/harbour/tests/tstmacro.prg b/harbour/tests/tstmacro.prg index 6cc41420b4..e3b187ffe8 100644 --- a/harbour/tests/tstmacro.prg +++ b/harbour/tests/tstmacro.prg @@ -100,7 +100,7 @@ FUNCTION SubFun() STATIC PROCEDURE TEST_TYPE() LOCAL v1, v2, v1a, v2a - LOCAL bErr := ErrorBlock( { |e|Break( e ) } ), oE + LOCAL bErr := ErrorBlock( {| e | Break( e ) } ), oE ? ? "=========== TYPE() function =================" diff --git a/harbour/tests/wvtext.prg b/harbour/tests/wvtext.prg index 135f077df4..7706f2c042 100644 --- a/harbour/tests/wvtext.prg +++ b/harbour/tests/wvtext.prg @@ -430,9 +430,9 @@ PROCEDURE thFunc() oBrowse:ColSep := " | " oBrowse:HeadSep := "-+-" - oBrowse:GoTopBlock := { || dbGoTop() } - oBrowse:GoBottomBlock := { || dbGoBottom() } - oBrowse:SkipBlock := { | nSkip | dbSkipBlock( nSkip, oBrowse ) } + oBrowse:GoTopBlock := {|| dbGoTop() } + oBrowse:GoBottomBlock := {|| dbGoBottom() } + oBrowse:SkipBlock := {| nSkip | dbSkipBlock( nSkip, oBrowse ) } FOR i := 1 TO Len( aStruct ) oBrowse:AddColumn( TBColumnNew( aStruct[ i, 1 ], BlockField( i ) ) ) @@ -535,7 +535,7 @@ STATIC FUNCTION TBPrev( oTbr ) STATIC FUNCTION BlockField( i ) - RETURN { || FieldGet( i ) } + RETURN {|| FieldGet( i ) } //-------------------------------------------------------------------//