From 55801b18c499a458b71232f1a2f11746e01681db Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 20 Aug 2008 11:04:28 +0000 Subject: [PATCH] 2008-08-20 12:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * tests/longdev.prg * tests/hbpptest/hbpptest.prg * tests/testcgi.prg * tests/foreach.prg * tests/onidle.prg * tests/tstchbx.prg * tests/codebl.prg * tests/tstdbi.prg * tests/vmasort.prg * tests/tstasort.prg * tests/testbrw.prg * tests/inkeytst.prg * tests/testrdd2.prg * tests/keywords.prg * tests/testhtml.prg * tests/readhrb.prg * tests/stripem.prg * tests/wvtext.prg * tests/testpre.prg * tests/seconds.prg * tests/fsplit.prg * tests/mousetst.prg * contrib/hbmysql/tmysql.prg * contrib/hbct/numconv.prg * contrib/hbct/ctmisc.prg * contrib/hbodbc/todbc.prg * contrib/hbapollo/tests/apollo.prg * contrib/hbnf/acctyear.prg * contrib/hbnf/acctadj.prg * contrib/hbnf/nwsem.prg * contrib/hbnf/week.prg * contrib/hbnf/acctmnth.prg * contrib/hbnf/savearr.prg * contrib/hbnf/madd.prg * contrib/hbnf/mouse1.prg * contrib/hbnf/month.prg * contrib/hbnf/findith.prg * contrib/hbnf/acctweek.prg * contrib/hbnf/pegs.prg * contrib/hbnf/acctqtr.prg * contrib/hbnf/nooccur.prg * contrib/hbnf/dayofyr.prg * contrib/hbnf/menu1.prg * contrib/hbnf/sqzn.prg * contrib/hbnf/asum.prg * contrib/hbnf/aavg.prg * contrib/hbnf/any2any.prg * contrib/hbnf/adessort.prg * contrib/hbnf/amedian.prg * contrib/hbnf/blink.prg * contrib/hbnf/qtr.prg * contrib/hbnf/aredit.prg * contrib/hbnf/xbox.prg * contrib/hbnf/ftround.prg * contrib/hbnf/invclr.prg * contrib/hbnf/tempfile.prg * contrib/hbnf/diskfunc.prg * contrib/hbnf/mouse2.prg * contrib/hbnf/daytobow.prg * contrib/hbnf/anomatch.prg * contrib/hbnf/datecnfg.prg * contrib/hbnf/tbwhile.prg * contrib/hbnf/year.prg * contrib/hbnf/elapsed.prg * contrib/hbnf/dfile.prg * contrib/hbnf/clrsel.prg * contrib/hbmisc/twirler.prg * contrib/hbmisc/fileread.prg * contrib/hbmisc/stringp.prg * contrib/hbgf/hbgfw32/winctrl.prg * contrib/hbgf/hbgfw32/form.prg * contrib/hbgf/hbgfos2/winctrl.prg * contrib/hbgf/hbgfos2/tform.prg * contrib/hbtip/httpcln.prg * contrib/hbvpdf/hbvpdf.prg * contrib/hbvpdf/hbvpdft.prg * contrib/examples/guestbk/guestbk.prg * contrib/examples/pe/editorhi.prg * Some more general code cleanups ( if() -> iif() ). --- harbour/ChangeLog | 81 ++++++++++++++++++++ harbour/contrib/examples/guestbk/guestbk.prg | 2 +- harbour/contrib/examples/pe/editorhi.prg | 50 ++++++------ harbour/contrib/hbapollo/tests/apollo.prg | 4 +- harbour/contrib/hbct/ctmisc.prg | 4 +- harbour/contrib/hbct/numconv.prg | 5 +- harbour/contrib/hbgf/hbgfos2/tform.prg | 2 +- harbour/contrib/hbgf/hbgfos2/winctrl.prg | 4 +- harbour/contrib/hbgf/hbgfw32/form.prg | 2 +- harbour/contrib/hbgf/hbgfw32/winctrl.prg | 4 +- harbour/contrib/hbmisc/fileread.prg | 3 +- harbour/contrib/hbmisc/stringp.prg | 10 +-- harbour/contrib/hbmisc/twirler.prg | 2 +- harbour/contrib/hbmysql/tmysql.prg | 6 +- harbour/contrib/hbnf/aavg.prg | 8 +- harbour/contrib/hbnf/acctadj.prg | 13 ++-- harbour/contrib/hbnf/acctmnth.prg | 6 +- harbour/contrib/hbnf/acctqtr.prg | 4 +- harbour/contrib/hbnf/acctweek.prg | 4 +- harbour/contrib/hbnf/acctyear.prg | 4 +- harbour/contrib/hbnf/adessort.prg | 8 +- harbour/contrib/hbnf/amedian.prg | 4 +- harbour/contrib/hbnf/anomatch.prg | 5 +- harbour/contrib/hbnf/any2any.prg | 37 +++++---- harbour/contrib/hbnf/aredit.prg | 6 +- harbour/contrib/hbnf/asum.prg | 6 +- harbour/contrib/hbnf/blink.prg | 6 +- harbour/contrib/hbnf/clrsel.prg | 2 +- harbour/contrib/hbnf/datecnfg.prg | 2 +- harbour/contrib/hbnf/dayofyr.prg | 4 +- harbour/contrib/hbnf/daytobow.prg | 9 ++- harbour/contrib/hbnf/dfile.prg | 26 +++---- harbour/contrib/hbnf/diskfunc.prg | 4 +- harbour/contrib/hbnf/elapsed.prg | 12 +-- harbour/contrib/hbnf/findith.prg | 4 +- harbour/contrib/hbnf/ftround.prg | 8 +- harbour/contrib/hbnf/invclr.prg | 8 +- harbour/contrib/hbnf/madd.prg | 8 +- harbour/contrib/hbnf/menu1.prg | 38 ++++----- harbour/contrib/hbnf/month.prg | 4 +- harbour/contrib/hbnf/mouse1.prg | 10 +-- harbour/contrib/hbnf/mouse2.prg | 10 +-- harbour/contrib/hbnf/nooccur.prg | 2 +- harbour/contrib/hbnf/nwsem.prg | 2 +- harbour/contrib/hbnf/pegs.prg | 2 +- harbour/contrib/hbnf/qtr.prg | 6 +- harbour/contrib/hbnf/savearr.prg | 4 +- harbour/contrib/hbnf/sqzn.prg | 16 ++-- harbour/contrib/hbnf/tbwhile.prg | 4 +- harbour/contrib/hbnf/tempfile.prg | 2 +- harbour/contrib/hbnf/week.prg | 4 +- harbour/contrib/hbnf/xbox.prg | 40 +++++----- harbour/contrib/hbnf/year.prg | 6 +- harbour/contrib/hbodbc/todbc.prg | 2 +- harbour/contrib/hbtip/httpcln.prg | 2 +- harbour/contrib/hbvpdf/hbvpdf.prg | 4 +- harbour/contrib/hbvpdf/hbvpdft.prg | 4 +- harbour/tests/codebl.prg | 4 +- harbour/tests/foreach.prg | 12 +-- harbour/tests/fsplit.prg | 4 +- harbour/tests/hbpptest/hbpptest.prg | 2 +- harbour/tests/inkeytst.prg | 2 +- harbour/tests/keywords.prg | 2 +- harbour/tests/longdev.prg | 8 +- harbour/tests/mousetst.prg | 2 +- harbour/tests/onidle.prg | 8 +- harbour/tests/readhrb.prg | 4 +- harbour/tests/seconds.prg | 8 +- harbour/tests/stripem.prg | 2 +- harbour/tests/testbrw.prg | 2 +- harbour/tests/testcgi.prg | 6 +- harbour/tests/testhtml.prg | 2 +- harbour/tests/testpre.prg | 4 +- harbour/tests/testrdd2.prg | 4 +- harbour/tests/tstasort.prg | 2 +- harbour/tests/tstchbx.prg | 4 +- harbour/tests/tstdbi.prg | 2 +- harbour/tests/vmasort.prg | 4 +- harbour/tests/wvtext.prg | 6 +- 79 files changed, 365 insertions(+), 268 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f389e735f4..32c43a185c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,87 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-20 12:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * tests/longdev.prg + * tests/hbpptest/hbpptest.prg + * tests/testcgi.prg + * tests/foreach.prg + * tests/onidle.prg + * tests/tstchbx.prg + * tests/codebl.prg + * tests/tstdbi.prg + * tests/vmasort.prg + * tests/tstasort.prg + * tests/testbrw.prg + * tests/inkeytst.prg + * tests/testrdd2.prg + * tests/keywords.prg + * tests/testhtml.prg + * tests/readhrb.prg + * tests/stripem.prg + * tests/wvtext.prg + * tests/testpre.prg + * tests/seconds.prg + * tests/fsplit.prg + * tests/mousetst.prg + * contrib/hbmysql/tmysql.prg + * contrib/hbct/numconv.prg + * contrib/hbct/ctmisc.prg + * contrib/hbodbc/todbc.prg + * contrib/hbapollo/tests/apollo.prg + * contrib/hbnf/acctyear.prg + * contrib/hbnf/acctadj.prg + * contrib/hbnf/nwsem.prg + * contrib/hbnf/week.prg + * contrib/hbnf/acctmnth.prg + * contrib/hbnf/savearr.prg + * contrib/hbnf/madd.prg + * contrib/hbnf/mouse1.prg + * contrib/hbnf/month.prg + * contrib/hbnf/findith.prg + * contrib/hbnf/acctweek.prg + * contrib/hbnf/pegs.prg + * contrib/hbnf/acctqtr.prg + * contrib/hbnf/nooccur.prg + * contrib/hbnf/dayofyr.prg + * contrib/hbnf/menu1.prg + * contrib/hbnf/sqzn.prg + * contrib/hbnf/asum.prg + * contrib/hbnf/aavg.prg + * contrib/hbnf/any2any.prg + * contrib/hbnf/adessort.prg + * contrib/hbnf/amedian.prg + * contrib/hbnf/blink.prg + * contrib/hbnf/qtr.prg + * contrib/hbnf/aredit.prg + * contrib/hbnf/xbox.prg + * contrib/hbnf/ftround.prg + * contrib/hbnf/invclr.prg + * contrib/hbnf/tempfile.prg + * contrib/hbnf/diskfunc.prg + * contrib/hbnf/mouse2.prg + * contrib/hbnf/daytobow.prg + * contrib/hbnf/anomatch.prg + * contrib/hbnf/datecnfg.prg + * contrib/hbnf/tbwhile.prg + * contrib/hbnf/year.prg + * contrib/hbnf/elapsed.prg + * contrib/hbnf/dfile.prg + * contrib/hbnf/clrsel.prg + * contrib/hbmisc/twirler.prg + * contrib/hbmisc/fileread.prg + * contrib/hbmisc/stringp.prg + * contrib/hbgf/hbgfw32/winctrl.prg + * contrib/hbgf/hbgfw32/form.prg + * contrib/hbgf/hbgfos2/winctrl.prg + * contrib/hbgf/hbgfos2/tform.prg + * contrib/hbtip/httpcln.prg + * contrib/hbvpdf/hbvpdf.prg + * contrib/hbvpdf/hbvpdft.prg + * contrib/examples/guestbk/guestbk.prg + * contrib/examples/pe/editorhi.prg + * Some more general code cleanups ( if() -> iif() ). + 2008-08-20 11:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * tests/onidle.prg * tests/codebloc.prg diff --git a/harbour/contrib/examples/guestbk/guestbk.prg b/harbour/contrib/examples/guestbk/guestbk.prg index 0ee4e0bde6..deb8b1acb0 100644 --- a/harbour/contrib/examples/guestbk/guestbk.prg +++ b/harbour/contrib/examples/guestbk/guestbk.prg @@ -129,7 +129,7 @@ FUNCTION Main() FOR i := 1 TO len( aEntries ) cCode += "" + chr(13) + chr(10) - cColor := if( Mod( i, 2 ) == 0, cEvenColor, cOddColor ) + cColor := iif( Mod( i, 2 ) == 0, cEvenColor, cOddColor ) FOR j := 1 TO oIni:ReadNumber( "Format", "FormatLines", 0 ) diff --git a/harbour/contrib/examples/pe/editorhi.prg b/harbour/contrib/examples/pe/editorhi.prg index 2d0a785570..2998c113cd 100644 --- a/harbour/contrib/examples/pe/editorhi.prg +++ b/harbour/contrib/examples/pe/editorhi.prg @@ -14,8 +14,8 @@ #define EXPORT -#define IFANY( x ) IF( (x) != NIL ) -#define IFNIL( x ) IF( (x) == NIL ) +#define IFANY( x ) IIF( (x) != NIL ) +#define IFNIL( x ) IIF( (x) == NIL ) #define IIFNIL( isnil, notnil ) IIF(notnil==NIL, isnil, notnil) #define EDIT_LOWER 0 // convert to lowercase @@ -73,11 +73,11 @@ EXPORT FUNCTION EditorNew( nTop, nLeft, nBottom, nRight, nLength, ; cFrame, cTitle, cColor, nSize, nEscape ) LOCAL nEdit, oEdit - IF( nLength == NIL ) + IF nLength == NIL nLength := 80 ENDIF nEdit := ED_New( nLength, 4, IIFNIL(nESize, nSize), nEscape ) - IF( nEdit >= 0 ) + IF nEdit >= 0 oEdit :=ARRAY( E_STRUCT_LEN ) oEdit[E_EDIT] := nEdit @@ -274,17 +274,17 @@ EXPORT FUNCTION EditorFile( xInput, cOutput, nLineLen, nHelp, ; LOCAL nHandle, nLen, oEdit, bF2, bF8, oHelp, lSaved:=.F., lClose:=.F. LOCAL nSize - IF( lSave == NIL ) + IF lSave == NIL lSave := .T. ENDIF - IF( VALTYPE(xInput) == "C" ) + IF VALTYPE(xInput) == "C" nHandle := FOPEN( xInput ) lClose := .T. ELSE nHandle := xInput ENDIF - IF( nHandle > 0 ) + IF nHandle > 0 nLen := MAX( FileLength( nHandle ), nESize ) ELSE nLen := nESize @@ -294,10 +294,10 @@ LOCAL nSize oEdit := EditorNew( 01,00,23,79, nLineLen, "--- ", cOutput, , ; nSize, nEscape ) - IF( nHandle > 0 ) + IF nHandle > 0 ED_ReadText( oEdit[E_EDIT], nHandle, 0, nLen, ; IIF( lConv==NIL, .F., lConv ) ) - IF( lClose ) + IF lClose FCLOSE( nHandle ) ENDIF ELSE @@ -307,11 +307,11 @@ LOCAL nSize EditorCargo( oEdit, cOutput ) // SAVELINE 24 TO oHelp WITH 80, ColorHelp( ,COLOR_EXTEND ) -// IF( lSave ) +// IF lSave // DisplayHelp( 73 ) //F2-save // bF2 := SETKEY( K_F2, {|oE| lSaved:=EditorSave(oE)} ) // ENDIF -// IF( lPrint != NIL .AND. lPrint ) +// IF lPrint != NIL .AND. lPrint // DisplayHelp( 74 ) //F8-print // bF8 := SETKEY( K_F8, {|oE| EditorPrint(oE)} ) // ENDIF @@ -319,11 +319,11 @@ LOCAL nSize lSaved :=EditorEdit( oEdit, EDIT_EDIT, .F., nHelp ) EditorKill( oEdit ) - IF( lSave ) + IF lSave SETKEY( K_F2, bF2 ) ENDIF -// IF( lPrint != NIL .AND. lPrint ) +// IF lPrint != NIL .AND. lPrint // SETKEY( K_F8, bF8 ) // ENDIF // RESTLINE FROM oHelp @@ -377,7 +377,7 @@ LOCAL lSaveAllowed, lSaved:=.F. oEdit[E_MODE] := lEdit ENDIF lSaveAllowed :=( SETKEY(K_F2) == NIL ) -// IF( lSaveAllowed ) +// IF lSaveAllowed // DisplayHelp( 73 ) //F2-save // ENDIF @@ -385,7 +385,7 @@ LOCAL lSaveAllowed, lSaved:=.F. nLeft := oEdit[E_LEFT] +1 nBottom := oEdit[E_BOTTOM] -1 nRight := oEdit[E_RIGHT] -1 - IF( lFrame != NIL .AND. !lFrame ) + IF lFrame != NIL .AND. !lFrame nLeft-- nBottom++ nRight++ @@ -413,11 +413,11 @@ LOCAL lSaveAllowed, lSaved:=.F. nRow := ED_Stabilize() //displays all visible lines // It don't uses incremantal stabilization for performance reasons - IF( nRow != ED_Row() ) + IF nRow != ED_Row() nRow := ED_Row() @ oEditor[E_TOP], nState SAY STRZERO( nRow,4 ) ENDIF - IF( nCol != ED_Col() ) + IF nCol != ED_Col() nCol := ED_Col() @ oEditor[E_TOP], nState+5 SAY STRZERO( nCol,3 ) ENDIF @@ -428,7 +428,7 @@ LOCAL lSaveAllowed, lSaved:=.F. DO CASE CASE( nKey>=32 .AND. nKey<256 ) - IF( oEdit[E_MODE] ) + IF oEdit[E_MODE] ED_PutChar( nKey, lInsert ) ENDIF @@ -453,7 +453,7 @@ LOCAL lSaveAllowed, lSaved:=.F. OTHERWISE bKey := SETKEY( nKey ) IFNIL( bKey ) - IF( oEdit[E_MODE] ) + IF oEdit[E_MODE] EditorKeys( nKey ) ENDIF ELSE @@ -598,20 +598,20 @@ STATIC FUNCTION EditorSave( oEdit ) LOCAL nHandle, cFile, cNew cFile := EditorCargo(oEdit) - IF( EMPTY(cFile) ) + IF EMPTY(cFile) cFile := "testfile.txt" //GetFileName( 10, 10 ) ENDIF - IF( EMPTY(cFile) ) + IF EMPTY(cFile) RETURN( .F. ) ENDIF /* WorkStart( 75 ) - IF( FILE(cFile) ) + IF FILE(cFile) cNew := FileExtension( cFile, "bak" ) DELETEFILE( cNew ) nHandle := RENAMEFILE( cFile, cNew ) - IF( nHandle < 0 ) + IF nHandle < 0 FileError( cFile, -nHandle ) WorkEnd() @@ -620,7 +620,7 @@ LOCAL nHandle, cFile, cNew ENDIF */ nHandle := FCREATE( cFile, FC_NORMAL ) - IF( nHandle > 0 ) + IF nHandle > 0 FWRITE( nHandle, EditorGetText(oEdit) ) FCLOSE( nHandle ) @@ -656,7 +656,7 @@ RETURN EXPORT FUNCTION SaveBox( top,left,bott,right, kolor, patt, head, shadow ) LOCAL cBox, cClr, nBottom,nRight - IF( PCOUNT() > 4 ) + IF PCOUNT() > 4 cClr := SETCOLOR(kolor) cBox := SAVESCREEN(top,left,bott,right) // cBox := BoxShadow(top,left,bott,right, , patt, head, shadow) diff --git a/harbour/contrib/hbapollo/tests/apollo.prg b/harbour/contrib/hbapollo/tests/apollo.prg index 0c9e4f3b55..ab8f312268 100644 --- a/harbour/contrib/hbapollo/tests/apollo.prg +++ b/harbour/contrib/hbapollo/tests/apollo.prg @@ -109,7 +109,7 @@ LOCAL f sx_Replace("NOTES" , SX_R_MEMO , "This is record " + LTrim( Str( f ) ) ) sx_Replace("AGE" , SX_R_DOUBLE , f ) sx_Replace("BIRTDATE" , SX_R_DATESTR, DtoC( Date() ) ) - // sx_Replace("MARRIED" , SX_R_LOGICAL, If(f%5==2,1,0) ) /* Logical does not work yet.. */ + // sx_Replace("MARRIED" , SX_R_LOGICAL, iif(f%5==2,1,0) ) /* Logical does not work yet.. */ sx_Commit() NEXT @@ -125,7 +125,7 @@ LOCAL f ? "RecNo...... : " + LTrim( Str( sx_RecNo() ) ) ? "Last name.. : " + sx_GetVariant( "LAST" ) ? "Birth date. : " + sx_GetVariant( "BIRTDATE" ) - ? "Married.... : " + If( sx_GetLogical( "MARRIED" ) , "Yes", "No, SINGLE!!") + ? "Married.... : " + iif( sx_GetLogical( "MARRIED" ) , "Yes", "No, SINGLE!!") sx_Skip(1) ENDDO diff --git a/harbour/contrib/hbct/ctmisc.prg b/harbour/contrib/hbct/ctmisc.prg index 275b475411..2ee60d040e 100644 --- a/harbour/contrib/hbct/ctmisc.prg +++ b/harbour/contrib/hbct/ctmisc.prg @@ -62,7 +62,7 @@ FUNCTION CENTER( c, n, p, lMode ) DEFAULT c TO "" DEFAULT lMode TO .F. cRet := PadC( AllTrim( c ), n, p ) - RETURN if(lMode, cRet, RTrim( cRet ) ) + RETURN iif(lMode, cRet, RTrim( cRet ) ) FUNCTION CSETCURS( l ) @@ -91,7 +91,7 @@ FUNCTION DOSPARAM LOCAL nCount := HB_ARGC(), i FOR i := 1 TO nCount - cRet += if(i==1, "", " ") + HB_ARGV( i ) + cRet += iif(i==1, "", " ") + HB_ARGV( i ) NEXT RETURN cRet diff --git a/harbour/contrib/hbct/numconv.prg b/harbour/contrib/hbct/numconv.prg index d7ad76b7fe..cf9bccc2da 100644 --- a/harbour/contrib/hbct/numconv.prg +++ b/harbour/contrib/hbct/numconv.prg @@ -173,7 +173,7 @@ LOCAL nInt IF nNum > 0 nInt := INT( nNum / nBase) - RETURN IIF(nInt==0, "", B10TOBN( nInt, @nBase )) +; + RETURN Iiif(nInt==0, "", B10TOBN( nInt, @nBase )) +; SUBSTR( WORLD, ( nNum % nBase ) + 1, 1 ) ELSEIF nNum == 0 @@ -269,9 +269,8 @@ FUNCTION CTOBIT( cCharString, cBitPattern ) FOR nI := 1 TO LEN( cBitPattern ) - cString := IF( AT(SUBSTR( cBitPattern, -nI, 1), cCharString) > 0, '1', '0') + cString + cString := iif( AT(SUBSTR( cBitPattern, -nI, 1), cCharString) > 0, '1', '0') + cString NEXT RETURN CTON( cString, 2 ) - diff --git a/harbour/contrib/hbgf/hbgfos2/tform.prg b/harbour/contrib/hbgf/hbgfos2/tform.prg index 4b2527fe1b..3ffb8cc6ca 100644 --- a/harbour/contrib/hbgf/hbgfos2/tform.prg +++ b/harbour/contrib/hbgf/hbgfos2/tform.prg @@ -127,7 +127,7 @@ METHOD Command( nNotifyCode, nId, hWndCtl ) CLASS HBForm do case case nNotifyCode == CMDSRC_MENU // Menu command if ::Menu != nil - if( oMenuItem := ::Menu:FindItem( nId ) ) != nil + if ( oMenuItem := ::Menu:FindItem( nId ) ) != nil if oMenuItem:OnClick != nil __ObjSendMsg( Self, oMenuItem:OnClick, oMenuItem ) endif diff --git a/harbour/contrib/hbgf/hbgfos2/winctrl.prg b/harbour/contrib/hbgf/hbgfos2/winctrl.prg index 3082e7a4c2..b7a00cf5e5 100644 --- a/harbour/contrib/hbgf/hbgfos2/winctrl.prg +++ b/harbour/contrib/hbgf/hbgfos2/winctrl.prg @@ -87,8 +87,8 @@ CLASS HBWinControl FROM HBPersistent ACCESS Width() INLINE WinGetWidth( ::hWnd ) PROPERTY ASSIGN Width( nNewWidth ) INLINE WinSetWidth( ::hWnd, nNewWidth ) - METHOD GetNewId() INLINE ::nId := If( ::nInitId == nil, ::nInitId := 1,; - ++::nInitId ) + METHOD GetNewId() INLINE ::nId := iif( ::nInitId == NIL, ::nInitId := 1,; + ++::nInitId ) METHOD Show() INLINE ShowWindow( ::hWnd, .T. /*SW_SHOWNA*/ ) diff --git a/harbour/contrib/hbgf/hbgfw32/form.prg b/harbour/contrib/hbgf/hbgfw32/form.prg index ae5fb91d8d..926558265e 100644 --- a/harbour/contrib/hbgf/hbgfw32/form.prg +++ b/harbour/contrib/hbgf/hbgfw32/form.prg @@ -103,7 +103,7 @@ METHOD Command( nNotifyCode, nId, hWndCtl ) CLASS HBForm if nNotifyCode == 0 // Menu command if ::Menu != nil - if( oMenuItem := ::Menu:FindItem( nId ) ) != nil + if ( oMenuItem := ::Menu:FindItem( nId ) ) != nil if oMenuItem:OnClick != nil __ObjSendMsg( Self, oMenuItem:OnClick, oMenuItem ) endif diff --git a/harbour/contrib/hbgf/hbgfw32/winctrl.prg b/harbour/contrib/hbgf/hbgfw32/winctrl.prg index 42fa563962..2d6f9f5f6f 100644 --- a/harbour/contrib/hbgf/hbgfw32/winctrl.prg +++ b/harbour/contrib/hbgf/hbgfw32/winctrl.prg @@ -80,8 +80,8 @@ CLASS HBWinControl FROM HBPersistent ACCESS Width() INLINE WinGetWidth( ::hWnd ) PROPERTY ASSIGN Width( nNewWidth ) INLINE WinSetWidth( ::hWnd, nNewWidth ) - METHOD GetNewId() INLINE ::nId := If( ::nInitId == nil, ::nInitId := 1,; - ++::nInitId ) + METHOD GetNewId() INLINE ::nId := iif( ::nInitId == nil, ::nInitId := 1,; + ++::nInitId ) METHOD Show() INLINE ShowWindow( ::hWnd, SW_SHOWNA ) diff --git a/harbour/contrib/hbmisc/fileread.prg b/harbour/contrib/hbmisc/fileread.prg index fd9c3e071d..b6d1957623 100644 --- a/harbour/contrib/hbmisc/fileread.prg +++ b/harbour/contrib/hbmisc/fileread.prg @@ -244,8 +244,7 @@ STATIC FUNCTION f_error_msg( cText ) ELSE nTemp := oSelf:nLastOp + 1 ENDIF - cMessage := IF( EMPTY( cText ), "", cText ) + "Error " + ALLTRIM( STR( oSelf:nError ) ) + " " + s_cAction[ nTemp ] + " " + oSelf:cFile + cMessage := iif( EMPTY( cText ), "", cText ) + "Error " + ALLTRIM( STR( oSelf:nError ) ) + " " + s_cAction[ nTemp ] + " " + oSelf:cFile ENDIF RETURN cMessage - diff --git a/harbour/contrib/hbmisc/stringp.prg b/harbour/contrib/hbmisc/stringp.prg index f98ff2acdc..36ecaf3d09 100644 --- a/harbour/contrib/hbmisc/stringp.prg +++ b/harbour/contrib/hbmisc/stringp.prg @@ -57,7 +57,7 @@ * $Description$ If argument is not set, return default * $End$ */ function Default( xArg, xDef ) -return if( ValType(xArg) != ValType(xDef), xDef, xArg ) +return iif( ValType(xArg) != ValType(xDef), xDef, xArg ) /* $Doc$ @@ -96,22 +96,22 @@ function ToChar( xTxt, cSeparator, lDebug ) do case case cValTxt=="C" .or. cValTxt=="M" // Character - cOut := if( lDebug, '"'+xTxt+'"', xTxt ) + cOut := iif( lDebug, '"'+xTxt+'"', xTxt ) case cValTxt=="N" // Numeric cOut := Alltrim(Str(xTxt)) case cValTxt=="U" // Nothing to write - cOut := if( lDebug, "NIL", "" ) + cOut := iif( lDebug, "NIL", "" ) case cValTxt=="D" // Date cOut := TransForm(xTxt, "") case cValTxt=="L" // Logical if lDebug - cOut := if( xTxt, ".T.", ".F." ) + cOut := iif( xTxt, ".T.", ".F." ) else - cOut := if( xTxt, "True", "False" ) + cOut := iif( xTxt, "True", "False" ) endif case cValTxt=="A" // Array diff --git a/harbour/contrib/hbmisc/twirler.prg b/harbour/contrib/hbmisc/twirler.prg index cf35e01427..9b64af21fb 100644 --- a/harbour/contrib/hbmisc/twirler.prg +++ b/harbour/contrib/hbmisc/twirler.prg @@ -28,7 +28,7 @@ method new( nRow, nCol, cTitle, cChars, nSmooth ) class Twirler ::n_Row := nRow ::n_Col := nCol ::n_Smooth := nSmooth - ::c_Chars := IF( EMPTY( cChars ), "|/-\", cChars ) + ::c_Chars := iif( EMPTY( cChars ), "|/-\", cChars ) ::c_Title := cTitle IF EMPTY( ::c_Title ) ::c_Title := "" diff --git a/harbour/contrib/hbmysql/tmysql.prg b/harbour/contrib/hbmysql/tmysql.prg index fe217bd164..8ba7db3e5b 100644 --- a/harbour/contrib/hbmysql/tmysql.prg +++ b/harbour/contrib/hbmysql/tmysql.prg @@ -1463,7 +1463,7 @@ METHOD CreateTable(cTable, aStruct,cPrimaryKey,cUniqueKey,cAuto) CLASS TMySQLSer for i := 1 to Len(aStruct) do case case aStruct[i][DBS_TYPE] == "C" - ::cCreateQuery += aStruct[i][DBS_NAME] + " char(" + AllTrim(Str(aStruct[i][DBS_LEN])) + ")" + Eval(cNN, aStruct[i])+ if(aStruct[i][DBS_NAME]==cPrimaryKey," NOT NULL ",'' )+ "," + ::cCreateQuery += aStruct[i][DBS_NAME] + " char(" + AllTrim(Str(aStruct[i][DBS_LEN])) + ")" + Eval(cNN, aStruct[i])+ iif(aStruct[i][DBS_NAME]==cPrimaryKey," NOT NULL ",'' )+ "," case aStruct[i][DBS_TYPE] == "M" ::cCreateQuery += aStruct[i][DBS_NAME] + " text" + Eval(cNN, aStruct[i]) + "," @@ -1471,7 +1471,7 @@ METHOD CreateTable(cTable, aStruct,cPrimaryKey,cUniqueKey,cAuto) CLASS TMySQLSer case aStruct[i][DBS_TYPE] == "N" /* if aStruct[i][DBS_DEC] == 0 - ::cCreateQuery += aStruct[i][DBS_NAME] + " int(" + AllTrim(Str(aStruct[i][DBS_LEN])) + ")" + Eval(cNN, aStruct[i]) + if(aStruct[i][DBS_NAME]==cPrimaryKey," NOT NULL ",'' )+ if(aStruct[i][DBS_NAME]==cAuto," auto_increment ",'' ) + "," + ::cCreateQuery += aStruct[i][DBS_NAME] + " int(" + AllTrim(Str(aStruct[i][DBS_LEN])) + ")" + Eval(cNN, aStruct[i]) + iif(aStruct[i][DBS_NAME]==cPrimaryKey," NOT NULL ",'' )+ iif(aStruct[i][DBS_NAME]==cAuto," auto_increment ",'' ) + "," else ::cCreateQuery += aStruct[i][DBS_NAME] + " real(" + AllTrim(Str(aStruct[i][DBS_LEN])) + "," + AllTrim(Str(aStruct[i][DBS_DEC])) + ")" + Eval(cNN, aStruct[i]) + "," endif @@ -1487,7 +1487,7 @@ METHOD CreateTable(cTable, aStruct,cPrimaryKey,cUniqueKey,cAuto) CLASS TMySQLSer otherwise ::cCreateQuery += aStruct[i][DBS_NAME] + " bigint(" + AllTrim(Str(aStruct[i][DBS_LEN])) + ")" endcase - ::cCreateQuery += Eval(cNN, aStruct[i]) + if(aStruct[i][DBS_NAME]==cPrimaryKey," NOT NULL ",'' )+ if(aStruct[i][DBS_NAME]==cAuto," auto_increment ",'' ) + "," + ::cCreateQuery += Eval(cNN, aStruct[i]) + iif(aStruct[i][DBS_NAME]==cPrimaryKey," NOT NULL ",'' )+ iif(aStruct[i][DBS_NAME]==cAuto," auto_increment ",'' ) + "," else ::cCreateQuery += aStruct[i][DBS_NAME] + " real(" + AllTrim(Str(aStruct[i][DBS_LEN])) + "," + AllTrim(Str(aStruct[i][DBS_DEC])) + ")" + Eval(cNN, aStruct[i]) + "," endif diff --git a/harbour/contrib/hbnf/aavg.prg b/harbour/contrib/hbnf/aavg.prg index 570f11bcc8..a55743d9c3 100644 --- a/harbour/contrib/hbnf/aavg.prg +++ b/harbour/contrib/hbnf/aavg.prg @@ -65,8 +65,8 @@ #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] @@ -80,7 +80,7 @@ FUNCTION FT_AAVG(aArray, nStartIndex, nEndIndex) FORCE_BETWEEN(1, nEndIndex, LEN(aArray)) FORCE_BETWEEN(1, nStartIndex, nEndIndex) - RETURN (IF(IS_NOT_ARRAY(aArray) .OR. LEN(aArray) == 0, ; + RETURN iif(IS_NOT_ARRAY(aArray) .OR. LEN(aArray) == 0, ; 0, ; FT_ASUM(aArray, nStartIndex, nEndIndex) / ; - (nEndIndex - nStartIndex + 1))) + (nEndIndex - nStartIndex + 1)) diff --git a/harbour/contrib/hbnf/acctadj.prg b/harbour/contrib/hbnf/acctadj.prg index 3a1a0ff495..51eb6f9e6c 100644 --- a/harbour/contrib/hbnf/acctadj.prg +++ b/harbour/contrib/hbnf/acctadj.prg @@ -93,8 +93,11 @@ FUNCTION FT_ACCTADJ(dGivenDate, lIsEnd) LOCAL nTemp - IF( VALTYPE(dGivenDate) != 'D', dGivenDate := DATE(), ) - lIsEnd := ( VALTYPE(lIsEnd) == 'L' ) + IF !( VALTYPE(dGivenDate) == "D" ) + dGivenDate := DATE() + ENDIF + + lIsEnd := VALTYPE(lIsEnd) == "L" nTemp := FT_DAYTOBOW(dGivenDate) IF nTemp > ( 2 + IF(!lIsEnd, 1, 0) ) @@ -103,8 +106,8 @@ FUNCTION FT_ACCTADJ(dGivenDate, lIsEnd) dGivenDate -= nTemp // This Week Start (Prior Week End + 1) ENDIF - IF( lIsEnd, dGivenDate -= 1, ) + IF lIsEnd + dGivenDate-- + ENDIF RETURN dGivenDate - - diff --git a/harbour/contrib/hbnf/acctmnth.prg b/harbour/contrib/hbnf/acctmnth.prg index 45f2c3630a..59838c20fc 100644 --- a/harbour/contrib/hbnf/acctmnth.prg +++ b/harbour/contrib/hbnf/acctmnth.prg @@ -124,7 +124,9 @@ FUNCTION FT_ACCTMONTH(dGivenDate,nMonthNum) lIsMonth := ( VALTYPE(nMonthNum) == 'N' ) IF lIsMonth - IF( nMonthNum < 1 .OR. nMonthNum > 12 , nMonthNum := 12, ) + IF nMonthNum < 1 .OR. nMonthNum > 12 + nMonthNum := 12 + ENDIF aRetVal := FT_MONTH(dGivenDate, nMonthNum) nYTemp := VAL(SUBSTR(aRetVal[1],1,4)) nMTemp := VAL(SUBSTR(aRetVal[1],5,2)) @@ -135,5 +137,3 @@ FUNCTION FT_ACCTMONTH(dGivenDate,nMonthNum) aRetVal[1] := STR(nYTemp,4) + PADL(LTRIM(STR(nMTemp,2)), 2, '0') RETURN aRetVal - - diff --git a/harbour/contrib/hbnf/acctqtr.prg b/harbour/contrib/hbnf/acctqtr.prg index b50512debc..cb5d1ada00 100644 --- a/harbour/contrib/hbnf/acctqtr.prg +++ b/harbour/contrib/hbnf/acctqtr.prg @@ -123,7 +123,9 @@ FUNCTION FT_ACCTQTR(dGivenDate,nQtrNum) lIsQtr := ( VALTYPE(nQtrNum) == 'N' ) IF lIsQtr - IF( nQtrNum < 1 .OR. nQtrNum > 4 , nQtrNum := 4, ) + IF nQtrNum < 1 .OR. nQtrNum > 4 + nQtrNum := 4 + ENDIF aRetVal := FT_QTR(dGivenDate, nQtrNum) nYTemp := VAL(SUBSTR(aRetVal[1],1,4)) nQTemp := VAL(SUBSTR(aRetVal[1],5,2)) diff --git a/harbour/contrib/hbnf/acctweek.prg b/harbour/contrib/hbnf/acctweek.prg index 0ad140af96..fab4b594d0 100644 --- a/harbour/contrib/hbnf/acctweek.prg +++ b/harbour/contrib/hbnf/acctweek.prg @@ -97,7 +97,9 @@ FUNCTION FT_ACCTWEEK(dGivenDate,nWeekNum) lIsWeek := ( VALTYPE(nWeekNum) == 'N' ) IF lIsWeek nTemp := INT( (aRetVal[3] - aRetVal[2]) / 7 ) + 1 - IF( nWeekNum < 1 .OR. nWeekNum > nTemp, nWeekNum := nTemp, ) + IF nWeekNum < 1 .OR. nWeekNum > nTemp + nWeekNum := nTemp + ENDIF dGivenDate := aRetVal[2] + (nWeekNum - 1) * 7 ENDIF diff --git a/harbour/contrib/hbnf/acctyear.prg b/harbour/contrib/hbnf/acctyear.prg index b72eb05e82..c89ea4e1a5 100644 --- a/harbour/contrib/hbnf/acctyear.prg +++ b/harbour/contrib/hbnf/acctyear.prg @@ -76,7 +76,9 @@ FUNCTION FT_ACCTYEAR(dGivenDate) LOCAL nYTemp, aRetVal - IF( VALTYPE(dGivenDate) != 'D', dGivenDate := DATE(), ) + IF !( VALTYPE(dGivenDate) == "D" ) + dGivenDate := DATE() + ENDIF aRetVal := FT_YEAR(dGivenDate) nYTemp := VAL(aRetVal[1]) diff --git a/harbour/contrib/hbnf/adessort.prg b/harbour/contrib/hbnf/adessort.prg index ca963f2201..e669c6ca38 100644 --- a/harbour/contrib/hbnf/adessort.prg +++ b/harbour/contrib/hbnf/adessort.prg @@ -60,14 +60,14 @@ #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] #command DEFAULT TO IF NOT ; [, TO IF NOT ] ; => ; - := IF(VALTYPE() == ,,) ; - [; := IF(VALTYPE() == ,,)] + := iif(VALTYPE() == ,,) ; + [; := iif(VALTYPE() == ,,)] #define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x)) diff --git a/harbour/contrib/hbnf/amedian.prg b/harbour/contrib/hbnf/amedian.prg index 25cc20b57e..0a404692d7 100644 --- a/harbour/contrib/hbnf/amedian.prg +++ b/harbour/contrib/hbnf/amedian.prg @@ -99,8 +99,8 @@ FUNCTION MAIN() #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] FUNCTION FT_AMEDIAN( aArray, nStart, nEnd ) diff --git a/harbour/contrib/hbnf/anomatch.prg b/harbour/contrib/hbnf/anomatch.prg index b1b12c2014..a090e4ad43 100644 --- a/harbour/contrib/hbnf/anomatch.prg +++ b/harbour/contrib/hbnf/anomatch.prg @@ -72,8 +72,8 @@ #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] FUNCTION FT_ANOMATCHES(aArray, bCompareBlock, nStartIndex, nEndIndex) @@ -92,4 +92,3 @@ FUNCTION FT_ANOMATCHES(aArray, bCompareBlock, nStartIndex, nEndIndex) nStartIndex, nEndIndex - nStartIndex + 1) RETURN (nNoOfMatches) // FT_ANoMatches - diff --git a/harbour/contrib/hbnf/any2any.prg b/harbour/contrib/hbnf/any2any.prg index cc052469bf..1c26d6481b 100644 --- a/harbour/contrib/hbnf/any2any.prg +++ b/harbour/contrib/hbnf/any2any.prg @@ -81,19 +81,19 @@ #Define XTOC(x) CASE_AT(VALTYPE(x), "CNDLM", ; { NULL, ; x, ; - IF(IS_NUMERIC(x),; + iif(IS_NUMERIC(x),; TRIM_NUMBER(x), ; NULL), ; - IF(IS_DATE(x),DTOC(x),NULL),; - IF(IS_LOGICAL(x),; - IF(x,".T.",".F."), ; + iif(IS_DATE(x),DTOC(x),NULL),; + iif(IS_LOGICAL(x),; + iif(x,".T.",".F."), ; NULL), ; x }) #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo) @@ -111,15 +111,15 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo) IS_NOT_DATE(xValueToConvert) - xValueToConvert := IF(IS_CHAR(xValueToConvert), ; + xValueToConvert := iif(IS_CHAR(xValueToConvert), ; ; // Convert from a Character CTOD(xValueToConvert), ; - IF(IS_NUMERIC(xValueToConvert), ; + iif(IS_NUMERIC(xValueToConvert), ; ; // Convert from a Number xValueToConvert + EARLIEST_DATE, ; - IF(IS_LOGICAL(xValueToConvert), ; + iif(IS_LOGICAL(xValueToConvert), ; ; // Convert from a Logical - IF(xValueToConvert, DATE(), BLANK_DATE), ; + iif(xValueToConvert, DATE(), BLANK_DATE), ; ; // Unsupported Type BLANK_DATE))) @@ -127,15 +127,15 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo) IS_NOT_NUMERIC(xValueToConvert) - xValueToConvert := IF(IS_CHAR(xValueToConvert), ; + xValueToConvert := iif(IS_CHAR(xValueToConvert), ; ; // Convert from a Character VAL(xValueToConvert), ; - IF(IS_DATE(xValueToConvert), ; + iif(IS_DATE(xValueToConvert), ; ; // Convert from a Date xValueToConvert - EARLIEST_DATE, ; - IF(IS_LOGICAL(xValueToConvert), ; + iif(IS_LOGICAL(xValueToConvert), ; ; // Convert from a Logical - IF(xValueToConvert, 1, 0), ; + iif(xValueToConvert, 1, 0), ; ; // Unsupported Type 0))) @@ -143,13 +143,13 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo) IS_NOT_LOGICAL(xValueToConvert) - xValueToConvert := IF(IS_CHAR(xValueToConvert), ; + xValueToConvert := iif(IS_CHAR(xValueToConvert), ; ; // Convert from a Character - UPPER(xValueToConvert) == IF(lWantYesNo,"Y",".T."), ; - IF(IS_DATE(xValueToConvert), ; + UPPER(xValueToConvert) == iif(lWantYesNo,"Y",".T."), ; + iif(IS_DATE(xValueToConvert), ; ; // Convert from a Date ! EMPTY(xValueToConvert), ; - IF(IS_NUMERIC(xValueToConvert), ; + iif(IS_NUMERIC(xValueToConvert), ; ; // Convert from a Number xValueToConvert != 0, ; ; // Unsupported Type @@ -170,4 +170,3 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo) ENDCASE RETURN (xValueToConvert) // XToY - diff --git a/harbour/contrib/hbnf/aredit.prg b/harbour/contrib/hbnf/aredit.prg index 52c9dce1de..11947b4c94 100644 --- a/harbour/contrib/hbnf/aredit.prg +++ b/harbour/contrib/hbnf/aredit.prg @@ -288,7 +288,7 @@ FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ; ENDIF EVAL(bGetFunc, b, ar, b:colPos, nElem ) * after get move to next field - KEYBOARD IF(b:colPos < b:colCount, ; + KEYBOARD iif(b:colPos < b:colCount, ; CHR(K_RIGHT), CHR(K_HOME) + CHR(K_DOWN) ) * Placing K_ENTER here below Edit Block (i.e. bGetFunc) @@ -302,6 +302,6 @@ FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ; ENDDO // WHILE !exit_requested RestScreen(nTop, nLeft, nBot, nRight, cSaveWin) * if no bGetFunc then ESC returns 0, otherwise return value of last element -RETURN IF( VALTYPE(bGetFunc) == NIL .AND. nKey == K_ESC, ; - 0, ar[b:colPos, nElem] ) +RETURN iif( VALTYPE(bGetFunc) == NIL .AND. nKey == K_ESC, ; + 0, ar[b:colPos, nElem] ) * EOFcn FT_ArEdit() diff --git a/harbour/contrib/hbnf/asum.prg b/harbour/contrib/hbnf/asum.prg index 207bdc4069..d10da878ea 100644 --- a/harbour/contrib/hbnf/asum.prg +++ b/harbour/contrib/hbnf/asum.prg @@ -65,8 +65,8 @@ #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] FUNCTION FT_ASUM(aArray, nStartIndex, nEndIndex) @@ -84,7 +84,7 @@ FUNCTION FT_ASUM(aArray, nStartIndex, nEndIndex) nSumTotal += ; CASE_AT(VALTYPE(xElement), "NC", ; { 0, xElement, ; - IF(IS_CHAR(xElement),LEN(xElement),0) }) }, ; + iif(IS_CHAR(xElement),LEN(xElement),0) }) }, ; nStartIndex, nEndIndex - nStartIndex + 1) RETURN (nSumTotal) // FT_ASum diff --git a/harbour/contrib/hbnf/blink.prg b/harbour/contrib/hbnf/blink.prg index 1e0910c784..427ea0c3c4 100644 --- a/harbour/contrib/hbnf/blink.prg +++ b/harbour/contrib/hbnf/blink.prg @@ -68,13 +68,13 @@ FUNCTION FT_BLINK( cMsg, nRow, nCol ) IF (cMsg == NIL) ; RETURN NIL; ENDIF * Set default row and col to current. - nRow := IF( nRow == NIL, ROW(), nRow ) - nCol := IF( nCol == NIL, COL(), nCol ) + nRow := iif( nRow == NIL, ROW(), nRow ) + nCol := iif( nCol == NIL, COL(), nCol ) cSavColor := SETCOLOR() // Save colors to restore on exit. * IF blink colors not already set, add blink to current foreground color. - SETCOLOR( IF( ("*" $ LEFT(cSavColor,4)), cSavColor, "*" + cSavColor ) ) + SETCOLOR( iif( ("*" $ LEFT(cSavColor,4)), cSavColor, "*" + cSavColor ) ) @ nRow, nCol SAY cMsg // Say the dreaded blinking msg. SETCOLOR( cSavColor ) // It's a wrap, restore colors & exit. diff --git a/harbour/contrib/hbnf/clrsel.prg b/harbour/contrib/hbnf/clrsel.prg index 1e431a05c3..0f6297e2b6 100644 --- a/harbour/contrib/hbnf/clrsel.prg +++ b/harbour/contrib/hbnf/clrsel.prg @@ -218,7 +218,7 @@ IF "EGA" $ UPPER( cVidMode ) SETMODE( 43, 80 ) ENDIF - lColour := IF( "MONO" $ UPPER( cVidMode ), .F., ISCOLOR() ) + lColour := iif( "MONO" $ UPPER( cVidMode ), .F., ISCOLOR() ) SET SCOREBOARD Off SETCURSOR( SC_NONE ) diff --git a/harbour/contrib/hbnf/datecnfg.prg b/harbour/contrib/hbnf/datecnfg.prg index 892def6676..5a8c7065e4 100644 --- a/harbour/contrib/hbnf/datecnfg.prg +++ b/harbour/contrib/hbnf/datecnfg.prg @@ -186,7 +186,7 @@ dGivenDate := DATE() ENDIF - nType := IF(nType == NIL .OR. VALTYPE(nType) != 'N', 0, nType) + nType := iif(nType == NIL .OR. VALTYPE(nType) != 'N', 0, nType) IF nType == 0 IF SUBSTR(cFY_Start,6,5) == "01.01" diff --git a/harbour/contrib/hbnf/dayofyr.prg b/harbour/contrib/hbnf/dayofyr.prg index 7d7ff22594..4c1eef36db 100644 --- a/harbour/contrib/hbnf/dayofyr.prg +++ b/harbour/contrib/hbnf/dayofyr.prg @@ -111,7 +111,9 @@ FUNCTION FT_DAYOFYR( dGivenDate, nDayNum, lIsAcct) IF lIsDay nTemp := aRetVal[3] - aRetVal[2] + 1 - IF(nDayNum < 1 .OR. nDayNum > nTemp , nDayNum := nTemp, ) + IF nDayNum < 1 .OR. nDayNum > nTemp + nDayNum := nTemp + ENDIF aRetVal[1] := aRetVal[2] + nDayNum - 1 ELSE aRetVal[1] += PADL(LTRIM(STR( dGivenDate - aRetVal[2] + 1, 3)), 3, '0') diff --git a/harbour/contrib/hbnf/daytobow.prg b/harbour/contrib/hbnf/daytobow.prg index abff285d79..09053cdea1 100644 --- a/harbour/contrib/hbnf/daytobow.prg +++ b/harbour/contrib/hbnf/daytobow.prg @@ -70,10 +70,13 @@ FUNCTION FT_DAYTOBOW( dGivenDate ) nDOW_Start := FT_DATECNFG()[2] - IF(VALTYPE(dGivenDate) != 'D', dGivenDate := DATE(), ) + IF VALTYPE(dGivenDate) != 'D' + dGivenDate := DATE() + ENDIF nRetVal := DOW( dGivenDate ) - nDOW_Start - IF( nRetVal < 0, nRetVal += 7, ) + IF nRetVal < 0 + nRetVal += 7 + ENDIF RETURN nRetVal - diff --git a/harbour/contrib/hbnf/dfile.prg b/harbour/contrib/hbnf/dfile.prg index faa1d9112b..1247d74340 100644 --- a/harbour/contrib/hbnf/dfile.prg +++ b/harbour/contrib/hbnf/dfile.prg @@ -148,24 +148,24 @@ function FT_DFSETUP(cInFile, nTop, nLeft, nBottom, nRight,; local rval := 0 if File(cInFile) - nTop := if(ValType(nTop) == "N", nTop, 0) - nLeft := if(ValType(nLeft) == "N", nLeft, 0) - nBottom := if(ValType(nBottom) == "N", nBottom, MaxRow()) - nRight := if(ValType(nRight) == "N", nRight, MaxCol()) + nTop := iif(ValType(nTop) == "N", nTop, 0) + nLeft := iif(ValType(nLeft) == "N", nLeft, 0) + nBottom := iif(ValType(nBottom) == "N", nBottom, MaxRow()) + nRight := iif(ValType(nRight) == "N", nRight, MaxCol()) - nCNormal := if(ValType(nCNormal) == "N", nCNormal, 7) - nCHighlight := if(ValType(nCHighlight) == "N", nCHighlight, 15) + nCNormal := iif(ValType(nCNormal) == "N", nCNormal, 7) + nCHighlight := iif(ValType(nCHighlight) == "N", nCHighlight, 15) - nStart := if(ValType(nStart) == "N", nStart, 1) - nColSkip := if(ValType(nColSkip) == "N", nColSkip, 1) - lBrowse := if(ValType(lBrowse) == "L", lBrowse, .F.) + nStart := iif(ValType(nStart) == "N", nStart, 1) + nColSkip := iif(ValType(nColSkip) == "N", nColSkip, 1) + lBrowse := iif(ValType(lBrowse) == "L", lBrowse, .F.) - nRMargin := if(ValType(nRMargin) == "N", nRMargin, 255) - nBuffSize := if(ValType(nBuffSize) == "N", nBuffSize, 4096) + nRMargin := iif(ValType(nRMargin) == "N", nRMargin, 255) + nBuffSize := iif(ValType(nBuffSize) == "N", nBuffSize, 4096) - cExitKeys := if(ValType(cExitKeys) == "C", cExitKeys, "") + cExitKeys := iif(ValType(cExitKeys) == "C", cExitKeys, "") - cExitKeys := if(Len(cExitKeys) > 25, SubStr(cExitKeys, 1, 25), cExitKeys) + cExitKeys := iif(Len(cExitKeys) > 25, SubStr(cExitKeys, 1, 25), cExitKeys) nHandle := FOpen(cInFile) diff --git a/harbour/contrib/hbnf/diskfunc.prg b/harbour/contrib/hbnf/diskfunc.prg index 0cf1053df3..53df4876b6 100644 --- a/harbour/contrib/hbnf/diskfunc.prg +++ b/harbour/contrib/hbnf/diskfunc.prg @@ -65,7 +65,7 @@ FUNCTION FT_DSKSIZE( cDrive ) local nDrive - nDrive := if( cDrive == NIL, 0, at( upper(cDrive), DRVTABLE ) ) + nDrive := iif( cDrive == NIL, 0, at( upper(cDrive), DRVTABLE ) ) Return DISKSPACE(nDrive,3) @@ -98,7 +98,7 @@ Return DISKSPACE(nDrive,3) FUNCTION FT_DSKFREE( cDrive ) local nDrive - nDrive := if( cDrive == NIL, 0, at( upper(cDrive), DRVTABLE ) ) + nDrive := iif( cDrive == NIL, 0, at( upper(cDrive), DRVTABLE ) ) RETURN DISKSPACE(nDrive,1) diff --git a/harbour/contrib/hbnf/elapsed.prg b/harbour/contrib/hbnf/elapsed.prg index 07e46cbd92..b539069735 100644 --- a/harbour/contrib/hbnf/elapsed.prg +++ b/harbour/contrib/hbnf/elapsed.prg @@ -41,7 +41,7 @@ FOR n = 1 to 4 ? aDataTest[n,1], STR(aDataTest[n,2], 12, 4) ?? " " - ?? IF(n == 1, 'Days', IF( n== 2, 'Hours', IF( n == 3, 'Mins.', 'Secs.'))) + ?? iif(n == 1, 'Days', iif( n== 2, 'Hours', iif( n == 3, 'Mins.', 'Secs.'))) NEXT RETURN NIL @@ -106,23 +106,23 @@ FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd) dEnd := DATE() ENDIF - IF( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', ) - IF( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', ) + IF VALTYPE(cTimeStart) != 'C' ; cTimeStart := '00:00:00' ; ENDIF + IF VALTYPE(cTimeEnd) != 'C' ; cTimeEnd := '00:00:00' ; ENDIF nTotalSec := (dEnd - dStart) * 86400 + ; VAL(cTimeEnd) * 3600 + ; VAL(SUBSTR(cTimeEnd,AT(':', cTimeEnd)+1,2)) * 60 + ; - IF(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ; + iif(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ; VAL(SUBSTR(cTimeEnd,RAT(':', cTimeEnd)+1))) - ; VAL(cTimeStart) * 3600 - ; VAL(SUBSTR(cTimeStart,AT(':', cTimeStart)+1,2)) * 60 - ; - IF(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ; + iif(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ; VAL(SUBSTR(cTimeStart,RAT(':', cTimeStart)+1))) nTemp := nTotalSec FOR nCtr = 1 to 4 - nConstant := IF(nCtr == 1, 86400, IF(nCtr == 2, 3600, IF( nCtr == 3, 60, 1))) + nConstant := iif(nCtr == 1, 86400, iif(nCtr == 2, 3600, iif( nCtr == 3, 60, 1))) aRetVal[nCtr,1] := INT(nTemp/nConstant) aRetval[nCtr,2] := nTotalSec / nConstant nTemp -= aRetVal[nCtr,1] * nConstant diff --git a/harbour/contrib/hbnf/findith.prg b/harbour/contrib/hbnf/findith.prg index 0966ff72e6..b28567eb43 100644 --- a/harbour/contrib/hbnf/findith.prg +++ b/harbour/contrib/hbnf/findith.prg @@ -97,9 +97,9 @@ FUNCTION FT_FINDITH(cCheckFor,cCheckIn,nWhichOccurrence,lIgnoreCase) ENDIF // IS_NOT_LOGICAL(lIgnoreCase) or // lIgnoreCase - RETURN (IF(nWhichOccurrence == 1, ; + RETURN (iif(nWhichOccurrence == 1, ; AT(cCheckFor, cCheckIn), ; - IF((nIthOccurrence := AT(cCheckFor, ; + iif((nIthOccurrence := AT(cCheckFor, ; STRTRAN(cCheckIn, cCheckFor, ; NULL, 1, ; nWhichOccurrence-1))) == 0, ; diff --git a/harbour/contrib/hbnf/ftround.prg b/harbour/contrib/hbnf/ftround.prg index 208f517e59..11143b258a 100644 --- a/harbour/contrib/hbnf/ftround.prg +++ b/harbour/contrib/hbnf/ftround.prg @@ -100,14 +100,14 @@ #command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] #command DEFAULT TO IF NOT ; [, TO IF NOT ] ; => ; - := IF(VALTYPE() == ,,) ; - [; := IF(VALTYPE() == ,,)] + := iif(VALTYPE() == ,,) ; + [; := iif(VALTYPE() == ,,)] diff --git a/harbour/contrib/hbnf/invclr.prg b/harbour/contrib/hbnf/invclr.prg index 3c24d3867d..8066540593 100644 --- a/harbour/contrib/hbnf/invclr.prg +++ b/harbour/contrib/hbnf/invclr.prg @@ -50,8 +50,8 @@ #Command DEFAULT TO [, TO ] ; => ; - := IF( == NIL,,) ; - [; := IF( == NIL,,)] + := iif( == NIL,,) ; + [; := iif( == NIL,,)] #define NULL "" @@ -66,8 +66,8 @@ FUNCTION FT_INVCLR(cDsrdColor) cDsrdColor := LEFT(cDsrdColor, AT(",", cDsrdColor+",")-1) // Get Any Modifiers - cModifiers := IF("*" $ cDsrdColor, "*", NULL) + ; - IF("+" $ cDsrdColor, "+", NULL) + cModifiers := iif("*" $ cDsrdColor, "*", NULL) + ; + iif("+" $ cDsrdColor, "+", NULL) // Separate the Fore/Background Colors cForeground := ALLTRIM(LEFT(cDsrdColor, AT("/", cDsrdColor) - 1)) diff --git a/harbour/contrib/hbnf/madd.prg b/harbour/contrib/hbnf/madd.prg index a4e6dd81e7..d09baf20c5 100644 --- a/harbour/contrib/hbnf/madd.prg +++ b/harbour/contrib/hbnf/madd.prg @@ -77,9 +77,9 @@ FUNCTION FT_MADD( dGivenDate, nAddMonths, lMakeEOM) LOCAL nAdjDay, dTemp, i - IF(VALTYPE(dGivenDate) != 'D', dGivenDate := DATE(), ) - IF(VALTYPE(nAddMonths) != 'N', nAddMonths := 0, ) - IF(VALTYPE(lMakeEOM) != 'L', lMakeEom := .F., ) + IF VALTYPE(dGivenDate) != 'D' ; dGivenDate := DATE() ; ENDIF + IF VALTYPE(nAddMonths) != 'N' ; nAddMonths := 0 ; ENDIF + IF VALTYPE(lMakeEOM) != 'L' ; lMakeEom := .F. ; ENDIF nAdjDay := DAY( dGivenDate ) - 1 @@ -92,7 +92,7 @@ FUNCTION FT_MADD( dGivenDate, nAddMonths, lMakeEOM) /* Work with 1st of months.*/ FOR i := 1 TO ABS(nAddMonths) - dTemp += IF( nAddMonths > 0, 31, -1 ) + dTemp += iif( nAddMonths > 0, 31, -1 ) dTemp += 1 - DAY( dTemp ) NEXT diff --git a/harbour/contrib/hbnf/menu1.prg b/harbour/contrib/hbnf/menu1.prg index d2642e67e1..ca3932d9ea 100644 --- a/harbour/contrib/hbnf/menu1.prg +++ b/harbour/contrib/hbnf/menu1.prg @@ -89,8 +89,8 @@ * * // fill color array * // Box Border, Menu Options, Menu Bar, Current Selection, Unselected - * aColors := IF( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ; - * {"W+/N", "W+/N", "W/N", "N/W","W/N"} ) + * aColors := iif( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ; + * {"W+/N", "W+/N", "W/N", "N/W","W/N"} ) * * // array for first pulldown menu * FT_FILL( aOptions[1], 'A. Execute A Dummy Procedure' , {|| fubar()}, .t. ) @@ -200,13 +200,13 @@ STATIC NHPOS, NVPOS, NMAXROW, NMAXCOL LOCAL aOptions[ LEN( aBar ) ] AEVAL( aBar, { |x,i| aOptions[i] := { {},{},{} } } ) - cCmdLine := IF( cCmdLine == NIL, "", cCmdLine ) + cCmdLine := iif( cCmdLine == NIL, "", cCmdLine ) - lColor := IF( "MONO" $ UPPER( cCmdLine ), .F., ISCOLOR() ) + lColor := iif( "MONO" $ UPPER( cCmdLine ), .F., ISCOLOR() ) * Border, Box, Bar, Current, Unselected - aColors := IF( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ; - {"W+/N", "W+/N", "W/N", "N/W", "W/N"} ) + aColors := iif( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ; + {"W+/N", "W+/N", "W/N", "N/W", "W/N"} ) FT_FILL( aOptions[1], 'A. Execute A Dummy Procedure' , {|| fubar()}, .t. ) FT_FILL( aOptions[1], 'B. Enter Daily Charge/Credit Slips' , {|| .t.}, .t. ) @@ -247,15 +247,15 @@ STATIC NHPOS, NVPOS, NMAXROW, NMAXCOL // main routine starts here SET SCOREBOARD OFF - cNormH := IF( lColor, "W+/G", "W+/N" ) - cNormN := IF( lColor, "N/G" , "W/N" ) - cNormE := IF( lColor, "N/W" , "N/W" ) - cWindH := IF( lColor, "W+/B", "W+/N" ) - cWindN := IF( lColor, "W/B" , "W/N" ) - cWindE := IF( lColor, "N/W" , "N/W" ) - cErrH := IF( lColor, "W+/R", "W+/N" ) - cErrN := IF( lColor, "W/R" , "W/N" ) - cErrE := IF( lColor, "N/W" , "N/W" ) + cNormH := iif( lColor, "W+/G", "W+/N" ) + cNormN := iif( lColor, "N/G" , "W/N" ) + cNormE := iif( lColor, "N/W" , "N/W" ) + cWindH := iif( lColor, "W+/B", "W+/N" ) + cWindN := iif( lColor, "W/B" , "W/N" ) + cWindE := iif( lColor, "N/W" , "N/W" ) + cErrH := iif( lColor, "W+/R", "W+/N" ) + cErrN := iif( lColor, "W/R" , "W/N" ) + cErrE := iif( lColor, "N/W" , "N/W" ) SAVE SCREEN TO sDosScrn nDosRow := ROW() @@ -346,7 +346,7 @@ FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow ) nMaxCol := MAXCOL() // row for menu bar - nTopRow := IF( nTopRow == NIL, 0, nTopRow ) + nTopRow := iif( nTopRow == NIL, 0, nTopRow ) AFILL(aLastSel,1) aChoices := aOptions @@ -404,9 +404,9 @@ FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow ) nVpos := ACHOICE( nTopRow+2, aBoxLoc[nHpos]+2, LEN(aChoices[nHpos,1])+nTopRow+2, aBarWidth[nHpos]+1+aBoxLoc[nHpos], aChoices[nHpos,1], aChoices[nHpos,3], "__ftAcUdf", aLastSel[nHpos]) DO CASE CASE LASTKEY() == RIGHTARROW .OR. LASTKEY() == TAB - IF( nHpos == LEN( aChoices ), nHpos := 1, nHpos := nHpos + 1 ) + nHpos := iif( nHpos == LEN( aChoices ), 1, nHpos + 1 ) CASE LASTKEY() == LEFTARROW .OR. LASTKEY() == SHIFTTAB - IF( nHpos == 1, nHpos := LEN( aChoices ), nHpos := nHpos - 1 ) + nHpos := iif( nHpos == 1, LEN( aChoices ), nHpos - 1 ) CASE LASTKEY() == ESCAPE lLooping := _ftBailOut( cBorder, cBox ) CASE LASTKEY() == HOME @@ -457,7 +457,7 @@ STATIC FUNCTION _ftWidest( i, aChoices, aBarWidth ) RETURN NIL STATIC FUNCTION _ftLocat( i, aBarCol, aBarWidth, aBoxLoc, nMaxCol ) - aBoxLoc[i] := IF( aBarCol[i] + aBarWidth[i] + 4 > nMaxCol + 1, ; + aBoxLoc[i] := iif( aBarCol[i] + aBarWidth[i] + 4 > nMaxCol + 1, ; nMaxCol - 3 - aBarWidth[i], aBarCol[i] ) RETURN NIL diff --git a/harbour/contrib/hbnf/month.prg b/harbour/contrib/hbnf/month.prg index 570222ce0e..0a72c7036b 100644 --- a/harbour/contrib/hbnf/month.prg +++ b/harbour/contrib/hbnf/month.prg @@ -99,7 +99,9 @@ LOCAL lIsMonth, nTemp, aRetVal lIsMonth := ( VALTYPE(nMonthNum) == 'N' ) IF lISMonth - IF( nMonthNum < 1 .OR. nMonthNum > 12, nMonthNum := 12, ) + IF nMonthNum < 1 .OR. nMonthNum > 12 + nMonthNum := 12 + ENDIF dGivenDate := FT_MADD(aRetVal[2], nMonthNum - 1) ENDIF diff --git a/harbour/contrib/hbnf/mouse1.prg b/harbour/contrib/hbnf/mouse1.prg index d35c0131e4..0b86d7ece7 100644 --- a/harbour/contrib/hbnf/mouse1.prg +++ b/harbour/contrib/hbnf/mouse1.prg @@ -995,8 +995,8 @@ RETURN NIL // no output from function FUNCTION FT_MGETPOS( nX, nY ) Local amse:={} - nX := if( nX == NIL, 0, nX ) - nY := if( nY == NIL, 0, nY ) + nX := iif( nX == NIL, 0, nX ) + nY := iif( nY == NIL, 0, nY ) /* aReg[AX] := 3 // set mouse function call 3 FT_INT86( 51, aReg ) // execute mouse interrupt @@ -1318,7 +1318,7 @@ RETURN aReg[4] // return button status * This function returns the release status of the mouse buttons and the * coordinates of the last release. * $EXAMPLES$ - * IF( FT_MBUTREL( 0 ) == 1 ) + * IF FT_MBUTREL( 0 ) == 1 * ? "Left button released" * ENDIF * $SEEALSO$ @@ -1457,8 +1457,8 @@ FUNCTION FT_MGETCOORD( nX, nY ) * Duplicated code from FT_MGETPOS() for speed reasons local aReg:={} local iButton - nX := if( nX == NIL, 0, nX ) - nY := if( nY == NIL, 0, nY ) + nX := iif( nX == NIL, 0, nX ) + nY := iif( nY == NIL, 0, nY ) /* aReg[AX] := 3 // set mouse function call 3 FT_INT86( 51, aReg ) // execute mouse interrupt diff --git a/harbour/contrib/hbnf/mouse2.prg b/harbour/contrib/hbnf/mouse2.prg index fb4dda994b..ba5d78e1c9 100644 --- a/harbour/contrib/hbnf/mouse2.prg +++ b/harbour/contrib/hbnf/mouse2.prg @@ -543,8 +543,8 @@ RETURN NIL // no output from function FUNCTION FT_MGETPOS( nX, nY ) - nX := if( nX == NIL, 0, nX ) - nY := if( nY == NIL, 0, nY ) + nX := iif( nX == NIL, 0, nX ) + nY := iif( nY == NIL, 0, nY ) aReg[AX] := 3 // set mouse function call 3 FT_INT86( 51, aReg ) // execute mouse interrupt @@ -598,8 +598,8 @@ FUNCTION FT_MGETCOORD( nX, nY ) * Duplicated code from FT_MGETPOS() for speed reasons - nX := if( nX == NIL, 0, nX ) - nY := if( nY == NIL, 0, nY ) + nX := iif( nX == NIL, 0, nX ) + nY := iif( nY == NIL, 0, nY ) aReg[AX] := 3 // set mouse function call 3 FT_INT86( 51, aReg ) // execute mouse interrupt @@ -913,7 +913,7 @@ RETURN aReg[AX] // return button status * This function returns the release status of the mouse buttons and the * coordinates of the last release. * $EXAMPLES$ - * IF( FT_MBUTREL( 0 ) == 1 ) + * IF FT_MBUTREL( 0 ) == 1 * ? "Left button released" * ENDIF * $SEEALSO$ diff --git a/harbour/contrib/hbnf/nooccur.prg b/harbour/contrib/hbnf/nooccur.prg index 50f3658122..42100418ae 100644 --- a/harbour/contrib/hbnf/nooccur.prg +++ b/harbour/contrib/hbnf/nooccur.prg @@ -74,7 +74,7 @@ FUNCTION FT_NOOCCUR(cCheckFor, cCheckIn, lIgnoreCase) ENDIF // IS_NOT_LOGICAL(lIgnoreCase) or ; // lIgnoreCase - RETURN (IF(LEN(cCheckFor) == 0 .OR. LEN(cCheckIn) == 0, ; + RETURN (iif(LEN(cCheckFor) == 0 .OR. LEN(cCheckIn) == 0, ; 0, ; INT((LEN(cCheckIn) - LEN(STRTRAN(cCheckIn, cCheckFor))) / ; LEN(cCheckFor)))) diff --git a/harbour/contrib/hbnf/nwsem.prg b/harbour/contrib/hbnf/nwsem.prg index 4003e6a22c..9508f19cde 100644 --- a/harbour/contrib/hbnf/nwsem.prg +++ b/harbour/contrib/hbnf/nwsem.prg @@ -44,7 +44,7 @@ #define INT21 33 #xcommand DEFAULT TO [, TO ]; - => IIF(()=NIL,:=,NIL) [; IF(()=NIL,:=,NIL)] + => IIF(()=NIL,:=,NIL) [; iif(()=NIL,:=,NIL)] #define WAIT_SEMAPHORE 2 #define SIGNAL_SEMAPHORE 3 diff --git a/harbour/contrib/hbnf/pegs.prg b/harbour/contrib/hbnf/pegs.prg index a512bfd2df..1ea15f0826 100644 --- a/harbour/contrib/hbnf/pegs.prg +++ b/harbour/contrib/hbnf/pegs.prg @@ -182,7 +182,7 @@ return NIL static function DrawBox(nelement) -setcolor(if(board_[nelement][4], '+w/rb', 'w/n')) +setcolor(iif(board_[nelement][4], '+w/rb', 'w/n')) @ board_[nelement][1,1], board_[nelement][1,2], board_[nelement][1,3], ; board_[nelement][1,4] box "ÚÄ¿³ÙÄÀ³ " DevPos(board_[nelement][1,1] + 1, board_[nelement][1,2] + 2) diff --git a/harbour/contrib/hbnf/qtr.prg b/harbour/contrib/hbnf/qtr.prg index 2466d0be65..58913506b3 100644 --- a/harbour/contrib/hbnf/qtr.prg +++ b/harbour/contrib/hbnf/qtr.prg @@ -99,12 +99,14 @@ LOCAL lIsQtr, nTemp, aRetVal lIsQtr := ( VALTYPE(nQtrNum) == 'N' ) IF lIsQtr - IF( nQtrNum < 1 .OR. nQtrNum > 4, nQtrNum := 4, ) + IF nQtrNum < 1 .OR. nQtrNum > 4 + nQtrNum := 4 + ENDIF dGivenDate := FT_MADD(aRetVal[2], 3*(nQtrNum - 1) ) ENDIF nTemp := MONTH( dGivenDate ) - MONTH( aRetVal[2] ) - nTemp += IF( nTemp >= 0, 1, 13 ) + nTemp += iif( nTemp >= 0, 1, 13 ) nTemp := INT( (nTemp - 1) / 3 ) aRetVal[1] += PADL(LTRIM(STR( nTemp + 1, 2)), 2, '0') diff --git a/harbour/contrib/hbnf/savearr.prg b/harbour/contrib/hbnf/savearr.prg index b9fa40ce7b..b1fe65d5d9 100644 --- a/harbour/contrib/hbnf/savearr.prg +++ b/harbour/contrib/hbnf/savearr.prg @@ -65,7 +65,7 @@ MEMVAR lRet ?? ' ' ?? STR(aTest[nk, 3]) ?? ' ' - ?? IF(aTest[nk, 4], 'true', 'false') + ?? iif(aTest[nk, 4], 'true', 'false') NEXT RETURN Nil #endif @@ -174,7 +174,7 @@ STATIC FUNCTION _ftsavesub(xMemVar, nHandle, nErrorCode) CASE cValType = "L" nLen := 1 FWrite(nHandle, L2Bin(nLen), 4) - FWrite(nHandle, IF(xMemVar, "T", "F") ) + FWrite(nHandle, iif(xMemVar, "T", "F") ) CASE cValType = "N" cString := STR(xMemVar) nLen := LEN(cString) diff --git a/harbour/contrib/hbnf/sqzn.prg b/harbour/contrib/hbnf/sqzn.prg index 6a1e438741..e38cd6877c 100644 --- a/harbour/contrib/hbnf/sqzn.prg +++ b/harbour/contrib/hbnf/sqzn.prg @@ -59,13 +59,13 @@ function ft_sqzn(nValue,nSize,nDecimals) local tmpstr,cCompressed,k - nSize := if(nSize ==NIL,10,nSize ) - nDecimals := if(nDecimals==NIL, 0,nDecimals ) + nSize := iif(nSize ==NIL,10,nSize ) + nDecimals := iif(nDecimals==NIL, 0,nDecimals ) nValue := nValue * (10**nDecimals) - nSize := if(nSize/2!=int(nSize/2),nSize+1,nSize) + nSize := iif(nSize/2!=int(nSize/2),nSize+1,nSize) tmpstr := str( abs(nValue),nSize ) tmpstr := strtran(tmpstr," ","0") - cCompressed := chr( val(substr(tmpstr,1,2))+if(nValue<0,128,0) ) + cCompressed := chr( val(substr(tmpstr,1,2))+iif(nValue<0,128,0) ) for k := 3 to len(tmpstr) step 2 cCompressed += chr(val(substr(tmpstr,k,2))) @@ -117,10 +117,10 @@ function ft_sqzn(nValue,nSize,nDecimals) function ft_unsqzn(cCompressed,nSize,nDecimals) local tmp:="",k,cValue,multi:=1 - nSize := if(nSize ==NIL,10,nSize ) - nDecimals := if(nDecimals==NIL, 0,nDecimals) - cCompressed := if(multi ==-1,substr(cCompressed,2),cCompressed) - nSize := if(nSize/2!=int(nSize/2),nSize+1,nSize) + nSize := iif(nSize ==NIL,10,nSize ) + nDecimals := iif(nDecimals==NIL, 0,nDecimals) + cCompressed := iif(multi ==-1,substr(cCompressed,2),cCompressed) + nSize := iif(nSize/2!=int(nSize/2),nSize+1,nSize) if asc(cCompressed) > 127 tmp := str(asc(cCompressed)-128,2) multi := -1 diff --git a/harbour/contrib/hbnf/tbwhile.prg b/harbour/contrib/hbnf/tbwhile.prg index 2d6a3c8ba3..1665fcf47f 100644 --- a/harbour/contrib/hbnf/tbwhile.prg +++ b/harbour/contrib/hbnf/tbwhile.prg @@ -311,7 +311,7 @@ FUNCTION FT_BRWSWHL(aFields, bWhileCond, cKey, nFreeze, lSaveScrn, ; /* these are color setups from tbdemo.prg from Nantucket */ * IF ( cType == "N" ) * column:defColor := {5, 6} - * column:colorBlock := {|x| if( x < 0, {7, 8}, {5, 6} )} + * column:colorBlock := {|x| iif( x < 0, {7, 8}, {5, 6} )} *ELSE * column:defColor := {3, 4} *ENDIF @@ -336,7 +336,7 @@ FUNCTION FT_BRWSWHL(aFields, bWhileCond, cKey, nFreeze, lSaveScrn, ; cColorSave := SetColor() /* Background Color Is Based On First Color In Passed cColorList - cColorBack := IF(',' $ cColorList, ; + cColorBack := iif(',' $ cColorList, ; SUBSTR(cColorList, 1, AT(',', cColorList) - 1), cColorList ) IF .NOT. lKeepScrn diff --git a/harbour/contrib/hbnf/tempfile.prg b/harbour/contrib/hbnf/tempfile.prg index 66eb4801c4..1a66097107 100644 --- a/harbour/contrib/hbnf/tempfile.prg +++ b/harbour/contrib/hbnf/tempfile.prg @@ -152,7 +152,7 @@ cPath = alltrim( cPath ) - nHandle := HB_FTempCreate( cPath, nil, if( lHide, FC_HIDDEN, FC_NORMAL ), @cFile ) + nHandle := HB_FTempCreate( cPath, nil, iif( lHide, FC_HIDDEN, FC_NORMAL ), @cFile ) if !hb_isbyref( @nHandle ) fclose( nHandle ) diff --git a/harbour/contrib/hbnf/week.prg b/harbour/contrib/hbnf/week.prg index 8c57028584..64bcfb2927 100644 --- a/harbour/contrib/hbnf/week.prg +++ b/harbour/contrib/hbnf/week.prg @@ -102,7 +102,9 @@ LOCAL lIsWeek, nTemp, aRetVal, dTemp lIsWeek := ( VALTYPE(nWeekNum) == 'N' ) IF lIsWeek nTemp := INT( (aRetVal[3] - aRetVal[2]) / 7 ) + 1 - IF(nWeekNum < 1 .OR. nWeekNum > nTemp , nWeekNum := nTemp, ) + IF nWeekNum < 1 .OR. nWeekNum > nTemp + nWeekNum := nTemp + ENDIF dGivenDate := aRetVal[2] + (nWeekNum - 1) * 7 ENDIF diff --git a/harbour/contrib/hbnf/xbox.prg b/harbour/contrib/hbnf/xbox.prg index e8d8a6200e..56935287f6 100644 --- a/harbour/contrib/hbnf/xbox.prg +++ b/harbour/contrib/hbnf/xbox.prg @@ -153,25 +153,25 @@ FUNCTION FT_XBOX(cJustType,; // "L" = left, otherwise centered aLines_[8] // validate parameters - cJustType := if(ValType(cJustType)='C',Upper(cJustType),'') - cRetWait := if(ValType(cRetWait )='C',Upper(cRetWait), '') - cBorType := if(ValType(cBorType )='C',Upper(cBorType), '') - cBorColor := if(ValType(cBoxColor)='C',cBorColor, 'N/W') - cBoxColor := if(ValType(cBoxColor)='C',cBoxColor, 'W/N') - nStartRow := if(ValType(nStartRow)='N',nStartRow,99) - nStartCol := if(ValType(nStartCol)='N',nStartCol,99) + cJustType := iif(ValType(cJustType)='C',Upper(cJustType),'') + cRetWait := iif(ValType(cRetWait )='C',Upper(cRetWait), '') + cBorType := iif(ValType(cBorType )='C',Upper(cBorType), '') + cBorColor := iif(ValType(cBoxColor)='C',cBorColor, 'N/W') + cBoxColor := iif(ValType(cBoxColor)='C',cBoxColor, 'W/N') + nStartRow := iif(ValType(nStartRow)='N',nStartRow,99) + nStartCol := iif(ValType(nStartCol)='N',nStartCol,99) nNumRows := Min(PCount()-7,8) //establish array of strings to be displayed - aLines_[1] := if(ValType(cLine1) = 'C',AllTrim(SubStr(cLine1,1,74)),'') - aLines_[2] := if(ValType(cLine2) = 'C',AllTrim(SubStr(cLine2,1,74)),'') - aLines_[3] := if(ValType(cLine3) = 'C',AllTrim(SubStr(cLine3,1,74)),'') - aLines_[4] := if(ValType(cLine4) = 'C',AllTrim(SubStr(cLine4,1,74)),'') - aLines_[5] := if(ValType(cLine5) = 'C',AllTrim(SubStr(cLine5,1,74)),'') - aLines_[6] := if(ValType(cLine6) = 'C',AllTrim(SubStr(cLine6,1,74)),'') - aLines_[7] := if(ValType(cLine7) = 'C',AllTrim(SubStr(cLine7,1,74)),'') - aLines_[8] := if(ValType(cLine8) = 'C',AllTrim(SubStr(cLine8,1,74)),'') + aLines_[1] := iif(ValType(cLine1) = 'C',AllTrim(SubStr(cLine1,1,74)),'') + aLines_[2] := iif(ValType(cLine2) = 'C',AllTrim(SubStr(cLine2,1,74)),'') + aLines_[3] := iif(ValType(cLine3) = 'C',AllTrim(SubStr(cLine3,1,74)),'') + aLines_[4] := iif(ValType(cLine4) = 'C',AllTrim(SubStr(cLine4,1,74)),'') + aLines_[5] := iif(ValType(cLine5) = 'C',AllTrim(SubStr(cLine5,1,74)),'') + aLines_[6] := iif(ValType(cLine6) = 'C',AllTrim(SubStr(cLine6,1,74)),'') + aLines_[7] := iif(ValType(cLine7) = 'C',AllTrim(SubStr(cLine7,1,74)),'') + aLines_[8] := iif(ValType(cLine8) = 'C',AllTrim(SubStr(cLine8,1,74)),'') ASize(aLines_,Min(nNumRows,8)) // determine longest line @@ -179,9 +179,9 @@ FUNCTION FT_XBOX(cJustType,; // "L" = left, otherwise centered AEVAL(aLines_,{|| nLLen:=Max(nLLen,Len(aLines_[nLoop])),nLoop++}) // calculate corners - nLCol = if(nStartCol==99,Int((76-nLLen)/2),Min(nStartCol,74-nLLen)) + nLCol = iif(nStartCol==99,Int((76-nLLen)/2),Min(nStartCol,74-nLLen)) nRCol = nLCol+nLLen+3 - nTRow = if(nStartRow==99,INT((24-nNumRows)/2),Min(nStartRow,22-nNumRows)) + nTRow = iif(nStartRow==99,INT((24-nNumRows)/2),Min(nStartRow,22-nNumRows)) nBRow = nTRow+nNumRows+1 // form box and border @@ -207,9 +207,9 @@ FUNCTION FT_XBOX(cJustType,; // "L" = left, otherwise centered nLoop :=1 AEVAL(aLines_,{|cSayStr|; nSayRow := nTRow+nLoop,; - nSayCol := if(cJustType = 'L',; - nLCol+2,; - nLCol+2+(nLLen-Int(Len(aLines_[nLoop])))/2),; + nSayCol := iif(cJustType = 'L',; + nLCol+2,; + nLCol+2+(nLLen-Int(Len(aLines_[nLoop])))/2),; nLoop++,; _FTSAY(nSayRow,nSayCol,cSayStr); }) diff --git a/harbour/contrib/hbnf/year.prg b/harbour/contrib/hbnf/year.prg index cd0777cc9f..a79d2e3a51 100644 --- a/harbour/contrib/hbnf/year.prg +++ b/harbour/contrib/hbnf/year.prg @@ -82,9 +82,11 @@ FUNCTION FT_YEAR(dGivenDate) cFY_Start := FT_DATECNFG()[1] cDateFormat := SET(_SET_DATEFORMAT, "yyyy.mm.dd") - IF( VALTYPE(dGivenDate) != 'D', dGivenDate := DATE(), ) + IF !( VALTYPE(dGivenDate) == 'D' ) + dGivenDate := DATE() + ENDIF - aRetVal[2] := CTOD(STR( YEAR(dGivenDate) - IF(MONTH(dGivenDate) < ; + aRetVal[2] := CTOD(STR( YEAR(dGivenDate) - iif(MONTH(dGivenDate) < ; MONTH(CTOD(cFY_Start)), 1, 0), 4) + ; SUBSTR(cFY_Start, 5, 6) ) aRetval[3] := FT_MADD(aRetVal[2], 12) - 1 diff --git a/harbour/contrib/hbodbc/todbc.prg b/harbour/contrib/hbodbc/todbc.prg index 96f1818c9c..30625859bc 100644 --- a/harbour/contrib/hbodbc/todbc.prg +++ b/harbour/contrib/hbodbc/todbc.prg @@ -240,7 +240,7 @@ METHOD SetAutocommit( lEnable ) CLASS TODBC DEFAULT lEnable TO .T. If lEnable != lOld - ::SetCnnOptions( SQL_AUTOCOMMIT, if( lEnable, SQL_AUTOCOMMIT_ON, SQL_AUTOCOMMIT_OFF ) ) + ::SetCnnOptions( SQL_AUTOCOMMIT, iif( lEnable, SQL_AUTOCOMMIT_ON, SQL_AUTOCOMMIT_OFF ) ) ::lAutoCommit := lEnable EndIf diff --git a/harbour/contrib/hbtip/httpcln.prg b/harbour/contrib/hbtip/httpcln.prg index 81caf5f1b4..86b0d2ddce 100644 --- a/harbour/contrib/hbtip/httpcln.prg +++ b/harbour/contrib/hbtip/httpcln.prg @@ -503,7 +503,7 @@ METHOD Boundary(nType) CLASS tIPClientHTTP NEXT ::cBoundary:=cBound endif - cBound:=iif(nType<2,"--","")+cBound+if(nType == 1,"--","") + cBound:=iif(nType<2,"--","")+cBound+iif(nType == 1,"--","") RETURN(cBound) METHOD Attach(cName,cFileName,cType) CLASS tIPClientHTTP diff --git a/harbour/contrib/hbvpdf/hbvpdf.prg b/harbour/contrib/hbvpdf/hbvpdf.prg index 6cd87b1da8..c4d968a95c 100644 --- a/harbour/contrib/hbvpdf/hbvpdf.prg +++ b/harbour/contrib/hbvpdf/hbvpdf.prg @@ -2678,7 +2678,7 @@ RETURN ( nLength ) function Array2File(cFile,aRay,nDepth,hFile) local nBytes := 0 local i -nDepth := if(ISNUMBER(nDepth),nDepth,0) +nDepth := iif(ISNUMBER(nDepth),nDepth,0) if hFile == NIL if (hFile := fCreate(cFile,FC_NORMAL)) == -1 return(nBytes) @@ -2706,7 +2706,7 @@ local cData := valtype(xData) elseif ISDATE(xData) cData += i2bin(8)+dtos(xData) elseif ISLOGICAL(xData) - cData += i2bin(1)+if(xData,'T','F') + cData += i2bin(1)+iif(xData,'T','F') elseif ISARRAY(xData) cData += i2bin(len(xData)) else diff --git a/harbour/contrib/hbvpdf/hbvpdft.prg b/harbour/contrib/hbvpdf/hbvpdft.prg index 81fa500460..ff3d394d00 100644 --- a/harbour/contrib/hbvpdf/hbvpdft.prg +++ b/harbour/contrib/hbvpdf/hbvpdft.prg @@ -2506,7 +2506,7 @@ local nBytes := 0 local i local lOpen := ( hFile != nil ) -nDepth := if( ISNUMBER( nDepth ), nDepth, 0 ) +nDepth := iif( ISNUMBER( nDepth ), nDepth, 0 ) //if hFile == NIL if !lOpen if ( hFile := fCreate( cFile,FC_NORMAL ) ) == -1 @@ -2540,7 +2540,7 @@ local cData := valtype(xData) elseif ISDATE( xData ) cData += i2bin( 8 )+dtos(xData) elseif ISLOGICAL(xData) - cData += i2bin( 1 )+if( xData,"T","F" ) + cData += i2bin( 1 )+iif( xData,"T","F" ) elseif ISARRAY( xData ) cData += i2bin( len( xData ) ) else diff --git a/harbour/tests/codebl.prg b/harbour/tests/codebl.prg index 3240c2620d..0000210404 100644 --- a/harbour/tests/codebl.prg +++ b/harbour/tests/codebl.prg @@ -56,7 +56,7 @@ LOCAL i a :=ARRAY( 100 ) FOR i:=1 TO 100 - IF( (i % 6) == 0 ) + IF (i % 6) == 0 a[ i-2 ] =NIL a[ i-4 ] =NIL ENDIF @@ -69,7 +69,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 diff --git a/harbour/tests/foreach.prg b/harbour/tests/foreach.prg index 685d513564..a1ad316a52 100644 --- a/harbour/tests/foreach.prg +++ b/harbour/tests/foreach.prg @@ -20,7 +20,7 @@ LOCAL i ? 'before loop: a[1]=',a[1], 'a[2]=',a[2], 'a[3]=',a[3] FOR EACH enum IN A ? "start: ENUM=", ENUM - IF( ENUM = 'two' ) + IF ENUM = 'two' ENUM := UPPER( ENUM ) ENDIF ? "end: ENUM=", ENUM, "| index:", ENUM:__enumIndex, "| value:", ENUM:__enumValue, "| base: ", VALTYPE(ENUM:__enumBase) @@ -37,7 +37,7 @@ LOCAL i ? "before loop: ENUM=",ENUM ? 'after loop: a[1]=',a[1], 'a[2]=',a[2], 'a[3]=',a[3] FOR EACH ENUM IN A - IF( UPPER(ENUM) = 'TWO' ) + IF UPPER(ENUM) = 'TWO' ENUM := UPPER( ENUM ) ? "before passing by @ | ENUM=", ENUM, "| index:", ENUM:__enumIndex, "| value:", ENUM:__enumValue, "| base: ", VALTYPE(ENUM:__enumBase) testBYREF( @ENUM ) @@ -71,7 +71,7 @@ LOCAL i BEGIN SEQUENCE FOR EACH enum IN c ? "start: ENUM=", ENUM - IF( enum = 'd' ) + IF enum = 'd' enum := UPPER( enum ) ENDIF Testbreak( enum ) @@ -101,7 +101,7 @@ LOCAL i FOR EACH enum IN a BEGIN SEQUENCE - IF( enum = '2' ) + IF enum = '2' BREAK ENDIF END SEQUENCE @@ -109,7 +109,7 @@ LOCAL i FOR EACH enum IN a BEGIN SEQUENCE - IF( enum = '2' ) + IF enum = '2' ? "Breaking... enum=", enum BREAK enum ENDIF @@ -122,7 +122,7 @@ RETURN PROCEDURE TESTbreak( v ) - IF( v = '2' .or. v = 'd' ) + IF v = '2' .or. v = 'd' ? "issuing break" BREAK( v ) ENDIF diff --git a/harbour/tests/fsplit.prg b/harbour/tests/fsplit.prg index f839e2c8ed..7a8cefcf7c 100644 --- a/harbour/tests/fsplit.prg +++ b/harbour/tests/fsplit.prg @@ -43,10 +43,10 @@ if pcount() == 0 endif // default destination name -csplit := if( csplit == nil, "split.", csplit + "." ) +csplit := iif( csplit == nil, "split.", csplit + "." ) // default size of each split file 360 x 1024 bytes -nbufsize := if( empty( nbyte ), 360, nbyte ) +nbufsize := iif( empty( nbyte ), 360, nbyte ) nbyte := nbufsize * 1024 // open the source file diff --git a/harbour/tests/hbpptest/hbpptest.prg b/harbour/tests/hbpptest/hbpptest.prg index e74af8beeb..d076a269e8 100644 --- a/harbour/tests/hbpptest/hbpptest.prg +++ b/harbour/tests/hbpptest/hbpptest.prg @@ -1237,7 +1237,7 @@ LOCAL i pCnt++ pre:=strtran(pre," "); out:=strtran(out," ") - IF( pre == out ) + IF pre == out RETURN 1 ELSE OutStd( pre, hb_OSNewLine() ) diff --git a/harbour/tests/inkeytst.prg b/harbour/tests/inkeytst.prg index 45dadd1e4e..c0e5f44130 100644 --- a/harbour/tests/inkeytst.prg +++ b/harbour/tests/inkeytst.prg @@ -244,7 +244,7 @@ LOCAL nKey, nMask, cText ? "The right mouse button was double-clicked." OTHERWISE ? "A keyboard key was pressed: ", nKey,; - IF( nKey >= 32 .AND. nKey <= 255, CHR( nKey ), "" ) + IIF( nKey >= 32 .AND. nKey <= 255, CHR( nKey ), "" ) END CASE END WHILE diff --git a/harbour/tests/keywords.prg b/harbour/tests/keywords.prg index ee23ee8fcd..120d55c9fe 100644 --- a/harbour/tests/keywords.prg +++ b/harbour/tests/keywords.prg @@ -22,7 +22,7 @@ STATIC for, in, include, init, loop, local, using, static, return, recover Function Main() //just to prevent any disaster if someone will want to run it - IF( .T. ) + IF .T. RETURN nil ENDIF diff --git a/harbour/tests/longdev.prg b/harbour/tests/longdev.prg index d6e89c8720..2956feda52 100644 --- a/harbour/tests/longdev.prg +++ b/harbour/tests/longdev.prg @@ -27,16 +27,16 @@ FUNCTION Main() SET DEVICE TO SCREEN // Confirm the string length and that a copy is exactly identical. - ? "The length of the long string is", IF( LEN( cLong ) == 80 * 1024, "correct", "wrong" ) + ? "The length of the long string is", iif( LEN( cLong ) == 80 * 1024, "correct", "wrong" ) cBuffer := cLong - ? "The length of a copy of the long string is", IF( LEN( cLong ) == 80 * 1024, "correct", "wrong" ) - ? "The copy of the long string is", IF( cLong == cBuffer, "equal", "not equal" ), "to the long string" + ? "The length of a copy of the long string is", iif( LEN( cLong ) == 80 * 1024, "correct", "wrong" ) + ? "The copy of the long string is", iif( cLong == cBuffer, "equal", "not equal" ), "to the long string" // Read the string back in and compare it to the original. nHandle := FOPEN( "long_str.prn" ) cBuffer := FREADSTR( nHandle, 90000 ) ? "Original:", LEN( cLong ) ? "From file:", LEN( cBuffer ) - ? "The strings are", IF( cLong == cBuffer, "equal", "not equal" ) + ? "The strings are", iif( cLong == cBuffer, "equal", "not equal" ) return nil diff --git a/harbour/tests/mousetst.prg b/harbour/tests/mousetst.prg index 3df8a8c55a..ede237349c 100644 --- a/harbour/tests/mousetst.prg +++ b/harbour/tests/mousetst.prg @@ -236,7 +236,7 @@ LOCAL cSkip := "", nKey, nPress := 0 OTHERWISE @ MAXROW(),20 SAY "A keyboard key was pressed: " @ MAXROW(),48 SAY nKey - @ MAXROW(),58 SAY IF( nKey >= 32 .AND. nKey <= 255, CHR( nKey ), "" ) + @ MAXROW(),58 SAY iif( nKey >= 32 .AND. nKey <= 255, CHR( nKey ), "" ) END CASE IF nPress > 6 diff --git a/harbour/tests/onidle.prg b/harbour/tests/onidle.prg index 3726e601e3..0b068f207e 100644 --- a/harbour/tests/onidle.prg +++ b/harbour/tests/onidle.prg @@ -29,19 +29,19 @@ LOCAL nPrev:=SECONDS() ? VALTYPE(nH1), nH1, VALTYPE(nH2), nH2, VALTYPE(nH3), nH3, VALTYPE(nH4), nH4 INKEY( 30 ) - IF( !EMPTY(nH3) ) + IF !EMPTY(nH3) @ 14,2 SAY "Delete task 3: " + HB_VALTOSTR(nH3) HB_IDLEDEL( nH3 ) ENDIF - IF( !EMPTY(nH2) ) + IF !EMPTY(nH2) @ 15,2 SAY "Delete task 2: " + HB_VALTOSTR(nH2) HB_IDLEDEL( nH2 ) ENDIF - IF( !EMPTY(nH1) ) + IF !EMPTY(nH1) @ 16,2 SAY "Delete task 1: " + HB_VALTOSTR(nH1) HB_IDLEDEL( nH1 ) ENDIF - IF( !EMPTY(nH4) ) + IF !EMPTY(nH4) @ 17,2 SAY "Delete task 4: " + HB_VALTOSTR(nH4) HB_IDLEDEL( nH4 ) ENDIF diff --git a/harbour/tests/readhrb.prg b/harbour/tests/readhrb.prg index 880c70ca4d..b751c54827 100644 --- a/harbour/tests/readhrb.prg +++ b/harbour/tests/readhrb.prg @@ -111,6 +111,4 @@ return HexDigit( int(nVal / 16) ) + HexDigit( int(nVal % 16) ) function HexDigit( nDigit ) -return if(nDigit>=10, chr( 55 + nDigit ), chr( 48 + nDigit ) ) - - +return iif(nDigit>=10, chr( 55 + nDigit ), chr( 48 + nDigit ) ) diff --git a/harbour/tests/seconds.prg b/harbour/tests/seconds.prg index 31fd04ef6f..d844b50842 100644 --- a/harbour/tests/seconds.prg +++ b/harbour/tests/seconds.prg @@ -12,17 +12,17 @@ function Main( cParam ) local n, limit := 10 local cNewLine := HB_OSNewLine() - IF( ! EMPTY( cParam ) ) + IF ! EMPTY( cParam ) limit := VAL( cParam ) - END IF + ENDIF OUTSTD( cNewLine ) OUTSTD( SECONDS() ) FOR n := 1 TO limit - IF( EMPTY( cParam ) ) + IF EMPTY( cParam ) OUTSTD( cNewLine ) OUTSTD( "Pause: " ) INKEY(0) - END IF + ENDIF OUTSTD( cNewLine ) OUTSTD( SECONDS() ) NEXT diff --git a/harbour/tests/stripem.prg b/harbour/tests/stripem.prg index df151997ce..df3564f90a 100644 --- a/harbour/tests/stripem.prg +++ b/harbour/tests/stripem.prg @@ -82,7 +82,7 @@ function TTextFile() // Parameter = dirty oFile:AddMethod( "Goto" , @Goto() ) // Go to line oFile:AddInline( "Run" , ; // Get/set data - {|self,xTxt,lCRLF|If( ::cMode == "R",::Read(),::WriteLn(xTxt, lCRLF)) } ) + {|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} ) diff --git a/harbour/tests/testbrw.prg b/harbour/tests/testbrw.prg index 6c52a51604..c3562b7859 100644 --- a/harbour/tests/testbrw.prg +++ b/harbour/tests/testbrw.prg @@ -28,7 +28,7 @@ function Main() oBrowse:GoTopBlock := { || n := 1 } oBrowse:GoBottomBlock := { || n := Len( aTest0 ) } oBrowse:SkipBlock := { | nSkip, nPos | nPos := n,; - n := If( nSkip > 0, Min( Len( aTest0 ), n + nSkip ),; + n := iif( nSkip > 0, Min( Len( aTest0 ), n + nSkip ),; Max( 1, n + nSkip )), n - nPos } oBrowse:AddColumn( TBColumnNew( "First", { || n } ) ) diff --git a/harbour/tests/testcgi.prg b/harbour/tests/testcgi.prg index 8b8cb05edf..b52e6e4ccf 100644 --- a/harbour/tests/testcgi.prg +++ b/harbour/tests/testcgi.prg @@ -76,17 +76,17 @@ FUNCTION Main() '' + chr(10)+chr(13) + ; '' + chr(10)+chr(13) + ; '' + chr(10)+chr(13) + ; '' + chr(10)+chr(13) + ; diff --git a/harbour/tests/testhtml.prg b/harbour/tests/testhtml.prg index 1af10be186..fe697d3b98 100644 --- a/harbour/tests/testhtml.prg +++ b/harbour/tests/testhtml.prg @@ -119,7 +119,7 @@ STATIC FUNCTION AddPara( cPara, cAlign ) LOCAL Self := QSelf() //Default( cAlign, "Left" ) // removed Patrick Mast 2000-06-07 - cAlign:=If(cAlign==NIL,"Left",cAlign) //Added Patrick Mast 2000-06-17 + cAlign:=iif(cAlign==NIL,"Left",cAlign) //Added Patrick Mast 2000-06-17 ::cBody := ::cBody + ; "

" + s_cNewLine + ; diff --git a/harbour/tests/testpre.prg b/harbour/tests/testpre.prg index 95a10efe2c..e6663a184b 100644 --- a/harbour/tests/testpre.prg +++ b/harbour/tests/testpre.prg @@ -62,12 +62,12 @@ FUNCTION Main() 'CLOSE ALL' } FOR j := 1 TO 2 - qOut( if( j = 1, "Before", "After" ) + " __Preprocess()" ) + qOut( iif( j = 1, "Before", "After" ) + " __Preprocess()" ) qOut( "===================" ) qOut( "" ) FOR i := 1 TO len( aScript ) - ? if( j = 1, aScript[i], __Preprocess( aScript[i] ) ) + ? iif( j = 1, aScript[i], __Preprocess( aScript[i] ) ) NEXT qOut( "" ) diff --git a/harbour/tests/testrdd2.prg b/harbour/tests/testrdd2.prg index e02809e2f9..8c10c12c47 100644 --- a/harbour/tests/testrdd2.prg +++ b/harbour/tests/testrdd2.prg @@ -164,7 +164,7 @@ do while LastRec() < MAX_TEST_RECS // TEST: Direct field assigment - MYTEST->NUM := ( if( RecNo() % 2 > 0, -1, 1 ) * RecNo() ) + ( RecNo() / 1000 ) + MYTEST->NUM := ( iif( RecNo() % 2 > 0, -1, 1 ) * RecNo() ) + ( RecNo() / 1000 ) MYTEST->DATE := Date() + Int( FIELD->NUM ) MYTEST->LOG := ( FIELD->NUM < 0 ) MYTEST->MEMO := Eval( bMemoText ) @@ -201,7 +201,7 @@ do while .not. EOF() if .not. Trim( FIELD->CHAR ) == Chr( 65 + Val( SubStr( LTrim( Str( RecNo() ) ), 2, 1 ) ) ) + ; " RECORD " + LTrim( Str( RecNo() ) ) .or. ; - .not. FIELD->NUM == ( if( RecNo() % 2 > 0, -1, 1 ) * RecNo() ) + ( RecNo() / 1000 ) .or. ; + .not. FIELD->NUM == ( iif( RecNo() % 2 > 0, -1, 1 ) * RecNo() ) + ( RecNo() / 1000 ) .or. ; .not. FIELD->DATE == Date() + Int( FIELD->NUM ) .or. ; .not. FIELD->LOG == ( FIELD->NUM < 0 ) .or. ; .not. FIELD->MEMO == Eval( bMemoText ) diff --git a/harbour/tests/tstasort.prg b/harbour/tests/tstasort.prg index ac3cc2f592..95d2a87fb3 100644 --- a/harbour/tests/tstasort.prg +++ b/harbour/tests/tstasort.prg @@ -51,7 +51,7 @@ function xToStr( xValue ) case cType == "D" return DToC( xValue ) case cType == "L" - return if( xValue, ".T.", ".F." ) + return iif( xValue, ".T.", ".F." ) case cType == "U" return "NIL" case cType == "A" diff --git a/harbour/tests/tstchbx.prg b/harbour/tests/tstchbx.prg index 3766437629..90f5b101d3 100644 --- a/harbour/tests/tstchbx.prg +++ b/harbour/tests/tstchbx.prg @@ -21,7 +21,7 @@ Setcolor('w/b+,r/b,g+/r,b+/r+,bg/n+,w/bg,rb/bg') @ 9,3 Say "Singer" @ 9,12 Get ly CHECKBOX color 'w/b+,w/b,w+/r,w/g+' MESSAGE "Are You a Singer" read MSG AT maxrow(), 0, maxcol() MSG Color "w/b+" -? "Is the Person Married",if(lx," Yes ", " No ") -? "Is the Person a Singer",if(ly," Yes ", " No ") +? "Is the Person Married",iif(lx," Yes ", " No ") +? "Is the Person a Singer",iif(ly," Yes ", " No ") ? "Your Os is ",cItem return Nil diff --git a/harbour/tests/tstdbi.prg b/harbour/tests/tstdbi.prg index 15108cfca2..73fab5eb65 100644 --- a/harbour/tests/tstdbi.prg +++ b/harbour/tests/tstdbi.prg @@ -59,7 +59,7 @@ static function xToStr( xValue ) case cType == "C" .or. cType == "M" cRet := xValue case cType == "L" - cRet := if( xValue, ".T.", ".F." ) + cRet := iif( xValue, ".T.", ".F." ) case cType == "A" cRet := "A" + AllTrim( Str( Len( xValue ) ) ) case cType == "U" diff --git a/harbour/tests/vmasort.prg b/harbour/tests/vmasort.prg index d79a721d6a..54f800f6eb 100644 --- a/harbour/tests/vmasort.prg +++ b/harbour/tests/vmasort.prg @@ -38,7 +38,7 @@ static function aMkArray( nPass ) aAdd( aData, NIL ) aAdd( aData, nMid - n ) aAdd( aData, Date() - n ) - aAdd( aData, if( n % 2 == 0, .f., .t. ) ) + aAdd( aData, iif( n % 2 == 0, .f., .t. ) ) aAdd( aData, Replicate( Chr( 64 + ( n % 256 ) ) , nPass ) ) aAdd( aData, {|| n } ) aAdd( aData, Array( n ) ) @@ -71,7 +71,7 @@ function xToStr( xValue ) case cType == "D" return DToC( xValue ) case cType == "L" - return if( xValue, ".T.", ".F." ) + return iif( xValue, ".T.", ".F." ) case cType == "U" return "NIL" case cType == "A" diff --git a/harbour/tests/wvtext.prg b/harbour/tests/wvtext.prg index 69f0f0dae7..2fb9d661e2 100644 --- a/harbour/tests/wvtext.prg +++ b/harbour/tests/wvtext.prg @@ -174,9 +174,9 @@ FUNCTION SetPalette( nMode ) static nG := 198 static nB := 198 - nR += if( nMode == 0, -5, 5 ) - nG += if( nMode == 0, -5, 5 ) - nB += if( nMode == 0, -5, 5 ) + nR += iif( nMode == 0, -5, 5 ) + nG += iif( nMode == 0, -5, 5 ) + nB += iif( nMode == 0, -5, 5 ) // Change "W" to slightly gray everytime you press F5 //

' + ; ParseString( cLine, ';', 1 ) + '' + ; - if( ParseString( cLine, ';', 2 ) = 'R', ; + iif( ParseString( cLine, ';', 2 ) = 'R', ; '
', ; ' ' ) + ; '
' + ; - if( ParseString( cLine, ';', 2 ) = 'S', ; + iif( ParseString( cLine, ';', 2 ) = 'S', ; '
', ; ' ' ) + ; '
' + ; - if( ParseString( cLine, ';', 2 ) = 'N', ; + iif( ParseString( cLine, ';', 2 ) = 'N', ; '
', ; ' ' ) + ; '