diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3a3606f036..b791c1b7f9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,35 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-04 17:44 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/gtwvg/tests/demowvg1.prg + * contrib/gtwvg/tests/demoxbp.prg + * contrib/hbmisc/doc/en/ht_dbf.txt + * doc/codebloc.txt + * doc/pcode.txt + * extras/gtwvw/tests/cbtest1.prg + * extras/gtwvw/tests/cbtest6.prg + * extras/gtwvw/tests/drawimg.prg + * extras/gtwvw/tests/ebtest7.prg + * extras/gtwvw/tests/inpfocus.prg + * extras/gtwvw/tests/maximize.prg + * extras/gtwvw/tests/prog0.prg + * extras/gtwvw/tests/prog1.prg + * extras/gtwvw/tests/prog2.prg + * extras/guestbk/guestbk.prg + * extras/httpsrv/uhttpd.prg + * extras/rddado/tests/mysql1.prg + * extras/rddado/tests/mysql3.prg + * tests/clsscope.prg + * tests/keywords.prg + * tests/rddtest/rddtst.prg + * tests/testwarn.prg + * startup functions converted to PROCEDUREs + + * extras/httpsrv/uhttpd.prg + ! fixed to return errorlevels using ERRORLEVEL() + function instead of Main() return value. + 2012-10-04 17:11 UTC+0200 Viktor Szakats (harbour syenar.net) * tests/aliaslck.prg * tests/files.prg diff --git a/harbour/contrib/gtwvg/tests/demowvg1.prg b/harbour/contrib/gtwvg/tests/demowvg1.prg index 4bf89b6257..19ce80a250 100644 --- a/harbour/contrib/gtwvg/tests/demowvg1.prg +++ b/harbour/contrib/gtwvg/tests/demowvg1.prg @@ -32,7 +32,7 @@ MEMVAR GetList // -FUNCTION Main() +PROCEDURE Main() LOCAL aPaint SET DATE ANSI @@ -64,7 +64,7 @@ FUNCTION Main() ExecForm( aPaint ) - RETURN NIL + RETURN // /* This function must be linked with the application */ diff --git a/harbour/contrib/gtwvg/tests/demoxbp.prg b/harbour/contrib/gtwvg/tests/demoxbp.prg index fec60158fa..0f839bb0b2 100644 --- a/harbour/contrib/gtwvg/tests/demoxbp.prg +++ b/harbour/contrib/gtwvg/tests/demoxbp.prg @@ -27,7 +27,7 @@ // -FUNCTION Main() +PROCEDURE Main() Local oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2 LOCAL oListBox, oCheck, oRadio, oStatic2, oMLE, oAddr LOCAL oPanel, oPanel1, oPanel2, cText, cNavigate, oDA @@ -264,7 +264,8 @@ FUNCTION Main() ENDDO oCrt:Destroy() - Return nil + + RETURN // diff --git a/harbour/contrib/hbmisc/doc/en/ht_dbf.txt b/harbour/contrib/hbmisc/doc/en/ht_dbf.txt index 8ec255c23d..e619e23878 100644 --- a/harbour/contrib/hbmisc/doc/en/ht_dbf.txt +++ b/harbour/contrib/hbmisc/doc/en/ht_dbf.txt @@ -76,7 +76,7 @@ * $DESCRIPTION$ * This function determines the size of a field, designated by its number. * $EXAMPLES$ - * FUNCTION Main() + * PROCEDURE Main() * LOCAL i * USE tests NEW * FOR i := 1 TO FCount() @@ -114,7 +114,7 @@ * $DESCRIPTION$ * This function determines the number of decimal places of a given numeric field. * $EXAMPLES$ - * FUNCTION Main() + * PROCEDURE Main() * LOCAL i * USE tests NEW * FOR i := 1 TO FCount() diff --git a/harbour/doc/codebloc.txt b/harbour/doc/codebloc.txt index b916143214..16985ed1f2 100644 --- a/harbour/doc/codebloc.txt +++ b/harbour/doc/codebloc.txt @@ -84,7 +84,7 @@ Incompatbility with the Clipper. the reference in a codeblock. The following code explains it (thanks to David G. Holm) -FUNCTION Main() +PROCEDURE Main() LOCAL nTest LOCAL bBlock1 := MakeBlock() LOCAL bBlock2 := {|| DoThing( @nTest ), QOut( "From Main: ", nTest ) } @@ -92,7 +92,7 @@ FUNCTION Main() Eval( bBlock1 ) Eval( bBlock2 ) - RETURN NIL + RETURN FUNCTION MakeBlock() LOCAL nTest diff --git a/harbour/doc/pcode.txt b/harbour/doc/pcode.txt index 443c810db9..d5459bc0f0 100644 --- a/harbour/doc/pcode.txt +++ b/harbour/doc/pcode.txt @@ -8,11 +8,11 @@ The Clipper OBJ and pcode model (GNU|Open|Clipper project) Let's consider the following Clipper sample Test.prg: -function Main() +FUNCTION Main() ? "Hello world!" -return nil + RETURN NIL Once it gets compiled into a OBJ, what is there inside it? @@ -127,4 +127,3 @@ to be continued... Antonio Linares www.fivetech.com - diff --git a/harbour/extras/gtwvw/tests/cbtest1.prg b/harbour/extras/gtwvw/tests/cbtest1.prg index 3b18893646..bfc3da3b03 100644 --- a/harbour/extras/gtwvw/tests/cbtest1.prg +++ b/harbour/extras/gtwvw/tests/cbtest1.prg @@ -30,7 +30,7 @@ static s_cThankYou := "Thanks for participating in our survey :-)" ANNOUNCE HB_NOSTARTUPWINDOW -proc main +PROCEDURE Main() local nMaxWidth, nCBid, nPBid, nPos local ch,ncursor setcolor("N/W") diff --git a/harbour/extras/gtwvw/tests/cbtest6.prg b/harbour/extras/gtwvw/tests/cbtest6.prg index 4752412a19..0731e5228b 100644 --- a/harbour/extras/gtwvw/tests/cbtest6.prg +++ b/harbour/extras/gtwvw/tests/cbtest6.prg @@ -52,7 +52,7 @@ MEMVAR __nCBid__,__temp__ ATAIL(GetList):cargo := __nCBid__; ; ATAIL(GetList):reader := {| get | CBreader(get)} -proc main +PROCEDURE Main() local getlist := {} local mname := padr("Budyanto Dj.",30), msex := "MALE", mage := 17, mstat := "married" local __nCBid__,__temp__ //these two are temporary var required by CB get creation diff --git a/harbour/extras/gtwvw/tests/drawimg.prg b/harbour/extras/gtwvw/tests/drawimg.prg index 6e7a2c08fd..ec55e92dd9 100644 --- a/harbour/extras/gtwvw/tests/drawimg.prg +++ b/harbour/extras/gtwvw/tests/drawimg.prg @@ -72,7 +72,7 @@ STATIC s_aPObjList := {} -proc main +PROCEDURE Main() local ntop := 7,; nleft:= 3,; nbot := maxrow()-2,; diff --git a/harbour/extras/gtwvw/tests/ebtest7.prg b/harbour/extras/gtwvw/tests/ebtest7.prg index 1654df84d8..766dfa268b 100644 --- a/harbour/extras/gtwvw/tests/ebtest7.prg +++ b/harbour/extras/gtwvw/tests/ebtest7.prg @@ -53,7 +53,7 @@ //REQUEST HB_NOSTARTUPWINDOW -proc main +PROCEDURE Main() local nOpen, nClose local lClosepermitted := .F. local bSetKey := SETKEY(K_F8, {|| MyHelp()}) diff --git a/harbour/extras/gtwvw/tests/inpfocus.prg b/harbour/extras/gtwvw/tests/inpfocus.prg index acf89e34be..97a1436cd5 100644 --- a/harbour/extras/gtwvw/tests/inpfocus.prg +++ b/harbour/extras/gtwvw/tests/inpfocus.prg @@ -45,7 +45,7 @@ //array of codeblock static s_akeyhandlers[_MAX_WINNUM] -proc main +PROCEDURE Main() local ch if !setmode(25,80) wvw_messagebox(0, "Cannot set to (25,80) screen", "Warning", MB_OK+MB_ICONEXCLAMATION) diff --git a/harbour/extras/gtwvw/tests/maximize.prg b/harbour/extras/gtwvw/tests/maximize.prg index 665b56c661..0c5e96afd6 100644 --- a/harbour/extras/gtwvw/tests/maximize.prg +++ b/harbour/extras/gtwvw/tests/maximize.prg @@ -15,7 +15,7 @@ static s_nNormalMaxcol := 79 STATIC s_lSizeReady := .F. -procedure main +PROCEDURE Main() local ch * activate WVW_SIZE() s_lSizeReady := .T. diff --git a/harbour/extras/gtwvw/tests/prog0.prg b/harbour/extras/gtwvw/tests/prog0.prg index 18544263e3..ddf221abef 100644 --- a/harbour/extras/gtwvw/tests/prog0.prg +++ b/harbour/extras/gtwvw/tests/prog0.prg @@ -25,7 +25,7 @@ static s_zwin := {} static s_cStdColor := "N/W,N/GR*,,,N/W*" -proc main +PROCEDURE Main() local i,j SET SCOREBOARD OFF SetColor( s_cStdColor ) diff --git a/harbour/extras/gtwvw/tests/prog1.prg b/harbour/extras/gtwvw/tests/prog1.prg index 34cf4b60cb..2b1201b9df 100644 --- a/harbour/extras/gtwvw/tests/prog1.prg +++ b/harbour/extras/gtwvw/tests/prog1.prg @@ -45,7 +45,7 @@ static s_zwin := {} static s_cStdColor := "N/W,N/GR*,,,N/W*" -proc main +PROCEDURE Main() local i,j #ifdef __GTWVW__ local lMainCoord := WVW_SetMainCoord( .T. ) diff --git a/harbour/extras/gtwvw/tests/prog2.prg b/harbour/extras/gtwvw/tests/prog2.prg index 0f1968b4ae..d44fbf26dc 100644 --- a/harbour/extras/gtwvw/tests/prog2.prg +++ b/harbour/extras/gtwvw/tests/prog2.prg @@ -37,7 +37,7 @@ static s_cStdColor := "N/W,N/GR*,,,N/W*" static s_amiscobjlist := {} //x misc object list (actually: list of codeblocks) #endif -proc main +PROCEDURE Main() local i,j #ifdef __GTWVW__ local lMainCoord := WVW_SetMainCoord( .T. ) diff --git a/harbour/extras/guestbk/guestbk.prg b/harbour/extras/guestbk/guestbk.prg index 8b98f01ea0..8d21f5dfa7 100644 --- a/harbour/extras/guestbk/guestbk.prg +++ b/harbour/extras/guestbk/guestbk.prg @@ -51,7 +51,7 @@ * */ -FUNCTION Main() +PROCEDURE Main() LOCAL oIni := TIniFile():New( "C:\inetpub\wwwroot\guestbk.ini" ) LOCAL oHTML := THTML():New() @@ -159,4 +159,4 @@ FUNCTION Main() ENDIF - RETURN NIL + RETURN diff --git a/harbour/extras/httpsrv/uhttpd.prg b/harbour/extras/httpsrv/uhttpd.prg index a64ae0b8c4..0af3f4b09d 100644 --- a/harbour/extras/httpsrv/uhttpd.prg +++ b/harbour/extras/httpsrv/uhttpd.prg @@ -207,7 +207,7 @@ ANNOUNCE ERRORSYS // // ---------------------------------------- -FUNCTION Main( ... ) +PROCEDURE Main( ... ) LOCAL nPort, hListen, hSocket, aRemote, cI, xVal LOCAL aThreads, nStartThreads, nMaxThreads, nStartServiceThreads LOCAL i, cPar, lStop @@ -222,7 +222,8 @@ FUNCTION Main( ... ) IF !HB_MTVM() ? "I need multhread support. Please, recompile me!" WAIT - RETURN 2 + ErrorLevel( 2 ) + RETURN ENDIF // ----------------------- Initializations --------------------------------- @@ -291,11 +292,11 @@ FUNCTION Main( ... ) CASE cPar == "--help" .OR. Lower( cPar ) == "-h" .OR. cPar == "-?" help() - RETURN 0 + RETURN OTHERWISE help() - RETURN 0 + RETURN ENDCASE ENDDO @@ -303,7 +304,7 @@ FUNCTION Main( ... ) IF lStop HB_MEMOWRIT( FILE_STOP, "" ) - RETURN 0 + RETURN ELSE FERASE( FILE_STOP ) ENDIF @@ -401,7 +402,8 @@ FUNCTION Main( ... ) IF nPort <= 0 .OR. nPort > 65535 ? "Invalid port number:", nPort WAIT - RETURN 1 + ErrorLevel( 1 ) + RETURN ENDIF IF HB_ISSTRING( cApplicationRoot ) @@ -415,12 +417,14 @@ FUNCTION Main( ... ) ELSE ? "Invalid application root:", cI WAIT - RETURN 3 + ErrorLevel( 3 ) + RETURN ENDIF ELSE ? "Invalid application root" WAIT - RETURN 3 + ErrorLevel( 3 ) + RETURN ENDIF #ifdef DEBUG_ACTIVE @@ -439,12 +443,14 @@ FUNCTION Main( ... ) ELSE ? "Invalid document root:", cI WAIT - RETURN 3 + ErrorLevel( 3 ) + RETURN ENDIF ELSE ? "Invalid document root" WAIT - RETURN 3 + ErrorLevel( 3 ) + RETURN ENDIF #ifdef DEBUG_ACTIVE @@ -494,14 +500,16 @@ FUNCTION Main( ... ) IF ( s_hfileLogAccess := FOPEN( cLogAccess, FO_CREAT + FO_WRITE ) ) == -1 ? "Can't open access log file" WAIT - RETURN 1 + ErrorLevel( 1 ) + RETURN ENDIF FSEEK( s_hfileLogAccess, 0, FS_END ) IF ( s_hfileLogError := FOPEN( cLogError, FO_CREAT + FO_WRITE ) ) == -1 ? "Can't open error log file" WAIT - RETURN 1 + ErrorLevel( 1 ) + RETURN ENDIF FSEEK( s_hfileLogError, 0, FS_END ) @@ -638,7 +646,7 @@ FUNCTION Main( ... ) SET CURSOR ON - RETURN 0 + RETURN // --------------------------------------------------------------------------------- // // THREAD FUNCTIONS diff --git a/harbour/extras/rddado/tests/mysql1.prg b/harbour/extras/rddado/tests/mysql1.prg index 21b333bb24..96c5bc2d04 100644 --- a/harbour/extras/rddado/tests/mysql1.prg +++ b/harbour/extras/rddado/tests/mysql1.prg @@ -6,7 +6,7 @@ REQUEST ADORDD -function Main() +PROCEDURE Main() USE test00 VIA "ADORDD" TABLE "ACCOUNTS" MYSQL ; FROM "www.freesql.org" USER "myuser" PASSWORD "mypass" @@ -15,4 +15,4 @@ function Main() USE -return nil + RETURN diff --git a/harbour/extras/rddado/tests/mysql3.prg b/harbour/extras/rddado/tests/mysql3.prg index 1c800385b7..425c72df0a 100644 --- a/harbour/extras/rddado/tests/mysql3.prg +++ b/harbour/extras/rddado/tests/mysql3.prg @@ -8,18 +8,18 @@ REQUEST ADORDD -function Main() +PROCEDURE Main() USE test00 VIA "ADORDD" TABLE "ACCOUNTS" MYSQL ; FROM "www.freesql.org" USER "myuser" PASSWORD "mypass" LOCATE FOR "City LIKE 'Chi*'" - while ! Eof() + DO WHILE ! EOF() ? test00->First, test00->City CONTINUE - end + ENDDO USE -return nil + RETURN diff --git a/harbour/tests/clsscope.prg b/harbour/tests/clsscope.prg index de5949bc5a..558fff5e60 100644 --- a/harbour/tests/clsscope.prg +++ b/harbour/tests/clsscope.prg @@ -161,7 +161,7 @@ -PROC MAIN() +proc main() LOCAL cbErr, self, o ? DATE(), TIME(), VERSION(), OS() diff --git a/harbour/tests/keywords.prg b/harbour/tests/keywords.prg index c8fccbabaa..41917a12e4 100644 --- a/harbour/tests/keywords.prg +++ b/harbour/tests/keywords.prg @@ -19,7 +19,7 @@ EXTERNAL __case, __begin STATIC nExt, bEgin, bReak, cAse, do, wHile, wIth, eXit, eXternal, fIeld STATIC for, in, include, init, loop, local, using, static, return, recover -FUNCTION Main() +FUNCTION NoTestMain() //just to prevent any disaster if someone will want to run it IF .T. diff --git a/harbour/tests/rddtest/rddtst.prg b/harbour/tests/rddtest/rddtst.prg index 1110ee9c58..d99e0a80b3 100644 --- a/harbour/tests/rddtest/rddtst.prg +++ b/harbour/tests/rddtest/rddtst.prg @@ -77,17 +77,17 @@ return //REQUEST DBSEEK, DBGOTO, DBGOTOP, DBGOBOTTOM, ORDSETFOCUS, ORDSCOPE #ifdef _TEST_CREATE_ - function main( cOutFile, rdd ) + procedure main( cOutFile, rdd ) test_init( rdd, cOutFile ) test_main() test_close() - return nil + return #else - function main( rdd ) + procedure main( rdd ) test_init( rdd ) test_main() test_close() - return nil + return #endif static function test_init(rdd,cOutFile) diff --git a/harbour/tests/testwarn.prg b/harbour/tests/testwarn.prg index 7348dbd50f..ddf2cd72ef 100644 --- a/harbour/tests/testwarn.prg +++ b/harbour/tests/testwarn.prg @@ -148,7 +148,7 @@ PROCEDURE Main1() FUNCTION Test() RETURN .T. -FUNCTION Main2() +FUNCTION Test2() Local n As Numeric, lVar AS LOGICAL n := iif( lVar, "A", 3 ) // iif() needs to be completed. @@ -159,7 +159,7 @@ FUNCTION Main2() RETURN NIL -FUNCTION Main3() +FUNCTION Test3() LOCAL n AS NUMERIC, cVar AS STRING, a[5,5,5] AS ARRAY OF STRING