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() ).
This commit is contained in:
@@ -8,6 +8,87 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
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
|
||||
|
||||
@@ -129,7 +129,7 @@ FUNCTION Main()
|
||||
FOR i := 1 TO len( aEntries )
|
||||
|
||||
cCode += "<TABLE WIDTH=100% CELLSPACING=0>" + 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 )
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 )
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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*/ )
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 )
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 := ""
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -60,14 +60,14 @@
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> IF NOT <Type1> ;
|
||||
[, <ParamN> TO <DefN> IF NOT <TypeN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(VALTYPE(<Param1>) == <Type1>,<Param1>,<Def1>) ;
|
||||
[; <ParamN> := IF(VALTYPE(<ParamN>) == <TypeN>,<ParamN>,<DefN>)]
|
||||
<Param1> := iif(VALTYPE(<Param1>) == <Type1>,<Param1>,<Def1>) ;
|
||||
[; <ParamN> := iif(VALTYPE(<ParamN>) == <TypeN>,<ParamN>,<DefN>)]
|
||||
|
||||
|
||||
#define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x))
|
||||
|
||||
@@ -99,8 +99,8 @@ FUNCTION MAIN()
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
FUNCTION FT_AMEDIAN( aArray, nStart, nEnd )
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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 <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, ;
|
||||
|
||||
@@ -100,14 +100,14 @@
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> IF NOT <Type1> ;
|
||||
[, <ParamN> TO <DefN> IF NOT <TypeN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(VALTYPE(<Param1>) == <Type1>,<Param1>,<Def1>) ;
|
||||
[; <ParamN> := IF(VALTYPE(<ParamN>) == <TypeN>,<ParamN>,<DefN>)]
|
||||
<Param1> := iif(VALTYPE(<Param1>) == <Type1>,<Param1>,<Def1>) ;
|
||||
[; <ParamN> := iif(VALTYPE(<ParamN>) == <TypeN>,<ParamN>,<DefN>)]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
|
||||
#Command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := IF(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := IF(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
#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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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$
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#define INT21 33
|
||||
|
||||
#xcommand DEFAULT <v1> TO <x1> [, <vN> TO <xN> ];
|
||||
=> IIF((<v1>)=NIL,<v1>:=<x1>,NIL) [; IF((<vN>)=NIL,<vN>:=<xN>,NIL)]
|
||||
=> IIF((<v1>)=NIL,<v1>:=<x1>,NIL) [; iif((<vN>)=NIL,<vN>:=<xN>,NIL)]
|
||||
|
||||
#define WAIT_SEMAPHORE 2
|
||||
#define SIGNAL_SEMAPHORE 3
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ) )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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} )
|
||||
|
||||
@@ -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 } ) )
|
||||
|
||||
@@ -76,17 +76,17 @@ FUNCTION Main()
|
||||
'<TD WIDTH="50%"><FONT SIZE="2" FACE="Tahoma">' + ;
|
||||
ParseString( cLine, ';', 1 ) + '</FONT></TD>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="16%">' + ;
|
||||
if( ParseString( cLine, ';', 2 ) = 'R', ;
|
||||
iif( ParseString( cLine, ';', 2 ) = 'R', ;
|
||||
'<CENTER><IMG SRC="images/purple-m.gif">', ;
|
||||
' ' ) + ;
|
||||
'</TD>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="16%">' + ;
|
||||
if( ParseString( cLine, ';', 2 ) = 'S', ;
|
||||
iif( ParseString( cLine, ';', 2 ) = 'S', ;
|
||||
'<CENTER><IMG SRC="images/purple-m.gif">', ;
|
||||
' ' ) + ;
|
||||
'</TD>' + chr(10)+chr(13) + ;
|
||||
'<TD WIDTH="16%">' + ;
|
||||
if( ParseString( cLine, ';', 2 ) = 'N', ;
|
||||
iif( ParseString( cLine, ';', 2 ) = 'N', ;
|
||||
'<CENTER><IMG SRC="images/purple-m.gif">', ;
|
||||
' ' ) + ;
|
||||
'</TD>' + chr(10)+chr(13) + ;
|
||||
|
||||
@@ -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 + ;
|
||||
"<P ALIGN='" + cAlign + "'>" + s_cNewLine + ;
|
||||
|
||||
@@ -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( "" )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user