2012-10-15 12:20 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbformat/hbfmtcls.prg
    * new TOFIX:
        ".T.," / ".F.," gets wrongly corrected to ".T. ," / ".F. ,"

  * contrib/hbct/tests/atrepl.prg
  * contrib/hbct/tests/ctwtest.prg
  * contrib/hbct/tests/datetime.prg
  * contrib/hbgd/gdbar.prg
  * contrib/hbgd/gdbarcod.prg
  * contrib/hbgd/tests/barms.prg
  * contrib/hbgd/tests/bartest.prg
  * contrib/hbgd/tests/gdtestcl.prg
  * contrib/hbgd/tests/test_out.prg
  * contrib/hbhpdf/tests/harupdf.prg
  * contrib/hbmisc/fcomma.prg
  * contrib/hbnf/calendar.prg
  * contrib/hbnf/dispmsg.prg
  * contrib/hbnf/floptst.prg
  * contrib/hbnf/ftround.prg
  * contrib/hbnf/mouse1.prg
  * contrib/hbnf/pegs.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/tempfile.prg
  * contrib/hbnf/tests/aading.prg
  * contrib/hbnf/tests/calendar.prg
  * contrib/hbnf/tests/clrsel.prg
  * contrib/hbnf/tests/dispmsg.prg
  * contrib/hbnf/tests/findith.prg
  * contrib/hbnf/tests/menu1.prg
  * contrib/hbnf/tests/tbwhile.prg
  * contrib/hbnf/tests/vertmenu.prg
  * contrib/hbsqlit3/tests/authoriz.prg
  * contrib/hbsqlit3/tests/backup.prg
  * contrib/hbsqlit3/tests/hooks.prg
  * contrib/hbsqlit3/tests/metadata.prg
  * contrib/hbsqlit3/tests/pack.prg
  * contrib/hbsqlit3/tests/sl3_test.prg
  * contrib/hbtip/sendmail.prg
  * contrib/hbtip/tests/base64.prg
  * contrib/hbtip/tests/httpadv.prg
  * contrib/hbtip/thtml.prg
  * contrib/hbtpathy/telepath.prg
  * contrib/hbwin/tests/testole.prg
  * contrib/rddads/tests/datad.prg
  * contrib/rddads/tests/testmg.prg
  * contrib/rddsql/tests/arrayrdd.prg
  * contrib/sddmy/tests/test1.prg
  * contrib/sddoci/tests/test1.prg
  * contrib/sddodbc/tests/test1.prg
  * contrib/sddodbc/tests/test2.prg
  * contrib/sddsqlt3/tests/test1.prg
  * contrib/xhb/dumpvar.prg
  * contrib/xhb/hblog.prg
  * contrib/xhb/trpc.prg
  * contrib/xhb/trpccli.prg
  * contrib/xhb/ttable.prg
  * contrib/xhb/xcstr.prg
  * contrib/xhb/xhberr.prg
  * contrib/xhb/xhbtedit.prg
  * extras/gtwvw/tests/cbtest6.prg
  * extras/gtwvw/tests/drawimg.prg
  * extras/gtwvw/tests/ebtest7.prg
  * extras/gtwvw/tests/maximize.prg
  * extras/gtwvw/tests/prog0.prg
  * extras/gtwvw/tests/prog1.prg
  * extras/gtwvw/tests/prog2.prg
  * extras/gtwvw/tests/wvwtest9.prg
  * extras/hbvpdf/hbvpdf.prg
  * extras/hbvpdf/tests/pdf_demo.prg
  * extras/httpsrv/modules/info.prg
  * extras/httpsrv/modules/showcounter.prg
  * tests/ac_test2.prg
  * tests/adirtest.prg
  * tests/and_or.prg
  * tests/brwpos.prg
  * tests/clasname.prg
  * tests/extend1.prg
  * tests/newrdd.prg
  * tests/testbrw.prg
  * tests/testcdx.prg
  * tests/testdbf.prg
  * tests/transtst.prg
  * tests/tstasort.prg
  * tests/usrrdd/exarr.prg
  * tests/usrrdd/exhsx.prg
    * formatting (mostly fixing one formatting error by hbformat)
This commit is contained in:
Viktor Szakats
2012-10-15 10:24:57 +00:00
parent 389b9d1c4a
commit 7d17a485e2
83 changed files with 587 additions and 478 deletions

View File

@@ -16,6 +16,94 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-15 12:20 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbformat/hbfmtcls.prg
* new TOFIX:
".T.," / ".F.," gets wrongly corrected to ".T. ," / ".F. ,"
* contrib/hbct/tests/atrepl.prg
* contrib/hbct/tests/ctwtest.prg
* contrib/hbct/tests/datetime.prg
* contrib/hbgd/gdbar.prg
* contrib/hbgd/gdbarcod.prg
* contrib/hbgd/tests/barms.prg
* contrib/hbgd/tests/bartest.prg
* contrib/hbgd/tests/gdtestcl.prg
* contrib/hbgd/tests/test_out.prg
* contrib/hbhpdf/tests/harupdf.prg
* contrib/hbmisc/fcomma.prg
* contrib/hbnf/calendar.prg
* contrib/hbnf/dispmsg.prg
* contrib/hbnf/floptst.prg
* contrib/hbnf/ftround.prg
* contrib/hbnf/mouse1.prg
* contrib/hbnf/pegs.prg
* contrib/hbnf/popadder.prg
* contrib/hbnf/tempfile.prg
* contrib/hbnf/tests/aading.prg
* contrib/hbnf/tests/calendar.prg
* contrib/hbnf/tests/clrsel.prg
* contrib/hbnf/tests/dispmsg.prg
* contrib/hbnf/tests/findith.prg
* contrib/hbnf/tests/menu1.prg
* contrib/hbnf/tests/tbwhile.prg
* contrib/hbnf/tests/vertmenu.prg
* contrib/hbsqlit3/tests/authoriz.prg
* contrib/hbsqlit3/tests/backup.prg
* contrib/hbsqlit3/tests/hooks.prg
* contrib/hbsqlit3/tests/metadata.prg
* contrib/hbsqlit3/tests/pack.prg
* contrib/hbsqlit3/tests/sl3_test.prg
* contrib/hbtip/sendmail.prg
* contrib/hbtip/tests/base64.prg
* contrib/hbtip/tests/httpadv.prg
* contrib/hbtip/thtml.prg
* contrib/hbtpathy/telepath.prg
* contrib/hbwin/tests/testole.prg
* contrib/rddads/tests/datad.prg
* contrib/rddads/tests/testmg.prg
* contrib/rddsql/tests/arrayrdd.prg
* contrib/sddmy/tests/test1.prg
* contrib/sddoci/tests/test1.prg
* contrib/sddodbc/tests/test1.prg
* contrib/sddodbc/tests/test2.prg
* contrib/sddsqlt3/tests/test1.prg
* contrib/xhb/dumpvar.prg
* contrib/xhb/hblog.prg
* contrib/xhb/trpc.prg
* contrib/xhb/trpccli.prg
* contrib/xhb/ttable.prg
* contrib/xhb/xcstr.prg
* contrib/xhb/xhberr.prg
* contrib/xhb/xhbtedit.prg
* extras/gtwvw/tests/cbtest6.prg
* extras/gtwvw/tests/drawimg.prg
* extras/gtwvw/tests/ebtest7.prg
* extras/gtwvw/tests/maximize.prg
* extras/gtwvw/tests/prog0.prg
* extras/gtwvw/tests/prog1.prg
* extras/gtwvw/tests/prog2.prg
* extras/gtwvw/tests/wvwtest9.prg
* extras/hbvpdf/hbvpdf.prg
* extras/hbvpdf/tests/pdf_demo.prg
* extras/httpsrv/modules/info.prg
* extras/httpsrv/modules/showcounter.prg
* tests/ac_test2.prg
* tests/adirtest.prg
* tests/and_or.prg
* tests/brwpos.prg
* tests/clasname.prg
* tests/extend1.prg
* tests/newrdd.prg
* tests/testbrw.prg
* tests/testcdx.prg
* tests/testdbf.prg
* tests/transtst.prg
* tests/tstasort.prg
* tests/usrrdd/exarr.prg
* tests/usrrdd/exhsx.prg
* formatting (mostly fixing one formatting error by hbformat)
2012-10-15 11:01 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/class.prg
* contrib/gtwvg/parthdlr.prg

View File

@@ -69,7 +69,7 @@ PROCEDURE Main()
? [ atrepl("ABC", "ABCDABCDABC", "xx", 2) == "xxDxxDABC" ? --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2 ) + ["]
? [ atrepl("ABC", "ABCDABCDABC", "xx", 2, .T.) == "ABCDxxDABC" ? --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T. ) + ["]
? [ atrepl("ABC", "ABCDABCDABC", "xx", 2, .T., 1) == "ABCDABCDxx" ? ]
? [ --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T. , 1 ) + ["]
? [ --> "] + atrepl( "ABC", "ABCDABCDABC", "xx", 2, .T., 1 ) + ["]
? "End test of ATREPL()"
?

View File

@@ -15,11 +15,11 @@
PROCEDURE Main()
LOCAL aWin := Array( 9 ), y, x, i, k, lFlag := .F. , lBoard := .T.
LOCAL aWin := Array( 9 ), y, x, i, k, lFlag := .F., lBoard := .T.
SetBlink( .F. )
wboard( 5, 5, 20, 75 )
wmode( .T. , .T. , .T. , .T. )
wmode( .T., .T., .T., .T. )
wsetshadow( 7 )
setclearA( 10 * 16 + 14 )
setclearB( 35 )

View File

@@ -613,7 +613,7 @@ FUNCTION dmytest()
IF nKey == K_ESC
c := .F.
ELSE
iif( cMode == "Y", lMode := .T. , lMode := .F. )
iif( cMode == "Y", lMode := .T., lMode := .F. )
@ 12, 10 SAY "The date string returned is " + ;
LTrim( dmy( ddate, lmode ) )

View File

@@ -66,6 +66,7 @@
// 2. '- 1' for numeric literals.
// 3. wrongly breaks line: 'FUNCTION Hello( /* comment */ )'
// 4. INIT PROCEDURE/EXIT PROCEDURE are not recognized as PROCEDURE statement
// 5. ".T.," / ".F.," gets wrongly corrected to ".T. ," / ".F. ,"
CREATE CLASS HBFORMATCODE

View File

@@ -132,8 +132,8 @@ METHOD CreateBar( sx, sy, filename, ccolor ) CLASS TBarCode
::filename := filename
ENDIF
::FillColor := ::SetColor( ::color_f[ 1 ] , ::color_f[ 2 ] , ::color_f[ 3 ] )
::BackColor := ::SetColor( ::color_b[ 1 ] , ::color_b[ 2 ] , ::color_b[ 3 ] )
::FillColor := ::SetColor( ::color_f[ 1 ], ::color_f[ 2 ], ::color_f[ 3 ] )
::BackColor := ::SetColor( ::color_b[ 1 ], ::color_b[ 2 ], ::color_b[ 3 ] )
::Setfont( "Arial" )
@@ -181,8 +181,8 @@ METHOD SetText( ptext ) CLASS TBarCode
METHOD ResetColor() CLASS TBarCode
::FillColor := ::SetColor( ::color_f[ 1 ] , ::color_f[ 2 ] , ::color_f[ 3 ] )
::BackColor := ::SetColor( ::color_b[ 1 ] , ::color_b[ 2 ] , ::color_b[ 3 ] )
::FillColor := ::SetColor( ::color_f[ 1 ], ::color_f[ 2 ], ::color_f[ 3 ] )
::BackColor := ::SetColor( ::color_b[ 1 ], ::color_b[ 2 ], ::color_b[ 3 ] )
RETURN NIL
@@ -202,7 +202,7 @@ METHOD DrawSingleBar( pcode ) CLASS TBarCode
FOR j := 1 TO Len( pcode )
FOR i := 1 TO ::res
::Line( ::positionX + i , ::positionY , ::positionX + i , ( ::positionY + ::maxHeight ) , ;
::Line( ::positionX + i, ::positionY, ::positionX + i, ( ::positionY + ::maxHeight ), ;
iif( SubStr( pcode, j, 1 ) $ "0", ::BackColor, ::FillColor ) )
NEXT
@@ -229,7 +229,7 @@ METHOD DrawSingleI25( pcode ) CLASS TBarCode
FOR j := 1 TO Len( pcode )
imgBar := iif( j % 2 == 0, ::FillColor, ::BackColor )
imgWid := iif( SubStr( pcode,j,1 ) == "0" , widthSlimBar, widthFatBar )
imgWid := iif( SubStr( pcode,j,1 ) == "0", widthSlimBar, widthFatBar )
end_y := ::maxHeight
@@ -248,7 +248,7 @@ METHOD DrawError( ptext ) CLASS TBarCode
::error ++
::lastX := iif( ( ::GetFontWidth() * Len(ptext ) ) > ::lastX , ( ::GetFontWidth() * Len(ptext ) ) , ::lastX )
::lastX := iif( ( ::GetFontWidth() * Len(ptext ) ) > ::lastX, ( ::GetFontWidth() * Len(ptext ) ), ::lastX )
::lastY := ::error * 15
RETURN NIL
@@ -274,7 +274,7 @@ METHOD DrawText( lIsI25 ) CLASS TBarCode
IF lIsI25
If ::textfont != 0
xPosition := 10 * ::GetFontWidth()
::say( xPosition, ::maxHeight, "*" + ::text + "*" , ::FillColor )
::say( xPosition, ::maxHeight, "*" + ::text + "*", ::FillColor )
::lastY := ::maxHeight + ::GetFontHeight()
ENDIF
ELSE

View File

@@ -212,7 +212,7 @@ METHOD Draw13( cText ) CLASS TCode
IF !lerror
// If we have to write text, we moved the barcode to the right to have space to put digit
::positionX := iif( ::textfont == 0 , 0, 10 )
::positionX := iif( ::textfont == 0, 0, 10 )
xParity := ::Parity[ Val( SubStr( ::text, 1, 1 ) ) ]
@@ -298,7 +298,7 @@ METHOD DrawText13() CLASS TCode
IF ::textfont != 0
::Say( 2, ::maxHeight - ( ::GetFontHeight() / 2 ), SubStr( ::text, 1, 1 ) , ::FillColor )
::Say( 2, ::maxHeight - ( ::GetFontHeight() / 2 ), SubStr( ::text, 1, 1 ), ::FillColor )
::Say( ( 10 + ( 3 * ::res + 48 * ::res ) / 2 ) - ( ::GetFontWidth() * ( 6 / 2 ) ), ::maxHeight + 1, SubStr( ::text, 2, 6 ), ::FillColor )
::Say( 10 + 46 * ::res + ( 3 * ::res + 46 * ::res ) / 2 - ::GetFontWidth() * ( 6 / 2 ), ::maxHeight + 1, SubStr( ::text, 8, 6 ), ::FillColor )

View File

@@ -23,7 +23,7 @@ PROCEDURE Main()
LOCAL ccode8 := "P48WBQ7BX3M73X8V3WRT7F9JW"
LOCAL ccode128 := "P48WBQ7BX3M73X8V3WRT7F9JW"
// LOCAL nlower := 1 , nhight := 50
// LOCAL nlower := 1, nhight := 50
/* here is the list of arguments
1- Barcode Type 13,8 and 128

View File

@@ -24,7 +24,7 @@ PROCEDURE Main()
// LOCAL ccode128 := "00011005100000000"
LOCAL ccode128 := "Code 128"
// LOCAL nlower := 1 , nhight := 50
// LOCAL nlower := 1, nhight := 50
/* here is the list of arguments
1- Barcode Type 13,8 and 128

View File

@@ -48,7 +48,7 @@ PROCEDURE Main()
cyan := oI:SetColor( 0, 255, 255 )
/* Draw rectangle */
oI:Rectangle( 0, 0, 199, 199, .T. , cyan )
oI:Rectangle( 0, 0, 199, 199, .T., cyan )
oI:Rectangle( 0, 0, 199, 199, , black )
oI:SetColor( blue )
@@ -89,7 +89,7 @@ PROCEDURE Main()
oI:AddPoint( 160, 180 )
oI:AddPoint( 170, 110 )
oI:AddPoint( 150, 160 )
oI:Polygon( , .T. , green )
oI:Polygon( , .T., green )
/* Draw an arc */
oI:Arc( 50, 50, 40, 40, 30, 190, , red )
@@ -293,7 +293,7 @@ PROCEDURE Main()
oI5:Clone():HorizontalBarChart():SaveJpeg( IMAGES_OUT + "horzbars.jpg" )
oI5:LineChart()
oI5:SaveJpeg( IMAGES_OUT + "hystogram1.jpg" )
oI5:SaveJpeg( IMAGES_OUT + "hystogrm.jpg" )
//oI4 := GDImage():CreateTrueColor( oI2:Width * 2, oI2:Height * 2 )
//oI2:CopyResampled( 0, 0, oI2:Width, oI2:Height, 0, 0, oI2:Width, oI2:Height, oI4 )

View File

@@ -84,7 +84,7 @@ PROCEDURE Main( ... )
OutHTML "</td></tr>"
OutHTML "<tr><td align='center'>"
OutHTML "<img src='test_out.exe?img=" + cPhoto + ;
iif( nWidth != NIL , "&width=" + hb_ntos( nWidth ) , "" ) + ;
iif( nWidth != NIL, "&width=" + hb_ntos( nWidth ), "" ) + ;
iif( nHeight != NIL, "&height=" + hb_ntos( nHeight ), "" ) + ;
"'>" + "<br>"
OutHTML "</td></tr>"
@@ -165,7 +165,7 @@ PROCEDURE OutJpg( cText, nPitch )
LOCAL blue
LOCAL aSize, nWidth, nHeight, nX, nY
hb_default( @cText , "Sample TEXT" )
hb_default( @cText, "Sample TEXT" )
hb_default( @nPitch, 30 )
/* Create an image in memory */

View File

@@ -725,7 +725,7 @@ STATIC FUNCTION Page_TextScaling( pdf )
/* measure the number of characters which included in the page. */
buf := samp_text
HPDF_Page_MeasureText( page, samp_text, ;
HPDF_Page_GetWidth( page ) - 120, .F. , NIL )
HPDF_Page_GetWidth( page ) - 120, .F., NIL )
HPDF_Page_ShowText( page, buf )

View File

@@ -123,7 +123,7 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo )
aOpenInfo[ UR_OI_ALIAS ] := cName
ENDIF
nMode := iif( aOpenInfo[ UR_OI_SHARED ], FO_SHARED , FO_EXCLUSIVE ) + ;
nMode := iif( aOpenInfo[ UR_OI_SHARED ], FO_SHARED, FO_EXCLUSIVE ) + ;
iif( aOpenInfo[ UR_OI_READONLY ], FO_READ, FO_READWRITE )
aRData := USRRDD_RDDDATA( USRRDD_ID( nWA ) )

View File

@@ -33,8 +33,8 @@ FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp )
nRow := iif( nRow != NIL, nRow, 1 ) //check display row
nCol := iif( nCol != NIL, nCol, 63 ) //check display col
cColor := iif( cColor != NIL, cColor, "W+/G" ) //check display color
lShadow := iif( lShadow == NIL , .F. , lShadow ) //check shadow switch
lShowHelp := iif( lShowHelp == NIL , .F. , lShowHelp )//check help switch
lShadow := iif( lShadow == NIL, .F., lShadow ) //check shadow switch
lShowHelp := iif( lShowHelp == NIL, .F., lShowHelp )//check help switch
nRow := iif( nRow < 1 .OR. nRow > 21, 1, nRow ) //check row bounds
nCol := iif( nCol < 1 .OR. nCol > 63, 63, nCol ) //check col bounds
@@ -49,7 +49,7 @@ FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp )
ENDIF
IF lShowHelp
nHelpRow := iif( nRow > 10 , nRow - 10 , nRow + 6 )
nHelpRow := iif( nRow > 10, nRow - 10, nRow + 6 )
ENDIF
DO WHILE nKey != K_ESC

View File

@@ -98,7 +98,7 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
cnBoxString := hb_UTF8ToStrBox( "┌─┐│┘─└│ " )
ENDIF
lShadow := iif( lShadow == NIL, .T. , lShadow )
lShadow := iif( lShadow == NIL, .T., lShadow )
cOldScreen := SaveScreen( nBoxTop, nBoxLeft, nBoxBottom + 1, nBoxRight + 2 )

View File

@@ -134,11 +134,11 @@ STATIC FUNCTION _ReadBootSector( ;
LOCAL nErrorCode
LOCAL lCarryFlag
aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number
aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1
aRegs[ BX ] := REG_ES // buffer in ES:BX
aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number
aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1
aRegs[ BX ] := REG_ES // buffer in ES:BX
aRegs[ ES ] := cBuffer
aRegs[ AX ] := makehi( 2 ) + 1 // AH = 02 read , AL=1 read one sector
aRegs[ AX ] := makehi( 2 ) + 1 // AH = 02 read, AL=1 read one sector
lSuccess := _CallInt13hRetry( aRegs, @lCarryFlag, @nErrorCode )
@@ -154,16 +154,16 @@ STATIC FUNCTION _WriteBootSector( ;
)
// call BIOS INT 13 for sector write
LOCAL aRegs[INT86_MAX_REGS]
LOCAL aRegs[ INT86_MAX_REGS ]
LOCAL lSuccess
LOCAL nErrorCode
LOCAL lCarryFlag
aRegs[ DX ] := nDriveNum // DH = 0 Head 0 , DL = drive number
aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1
aRegs[ BX ] := REG_ES // buffer in ES:BX
aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number
aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1
aRegs[ BX ] := REG_ES // buffer in ES:BX
aRegs[ ES ] := cBuffer_i
aRegs[ AX ] := makehi( 3 ) + 1 // AH = 03 write , AL=1 read one sector
aRegs[ AX ] := makehi( 3 ) + 1 // AH = 03 write, AL=1 read one sector
lSuccess := _CallInt13hRetry( aRegs, @lCarryFlag, @nErrorCode )

View File

@@ -62,7 +62,7 @@ FUNCTION FT_ROUND( nNumber, nRoundToAmount, cRoundType, cRoundDirection, ;
; // Yes, Make Downward Adjustment
1 / nRoundToAmount / 2, ;
; // Are We Rounding Up??
iif( Left( cRoundDirection, 1 ) == ROUND_UP , ;
iif( Left( cRoundDirection, 1 ) == ROUND_UP, ;
; // Yes, Make Upward Adjustment
- 1 / ( nRoundToAmount ) / 2, ;
; // No, Rounding Normal, No Adjustment

View File

@@ -61,8 +61,8 @@ FUNCTION FT_MDBLCLK( nClick, nButton, nInterval, nRow, nCol, nStart )
DO WHILE !lDone
FT_MBUTPRS( nButton, @nPrs, @nVert, @nHorz )
nVert := Int( nVert/8 )
nHorz := Int( nHorz/8 )
nVert := Int( nVert / 8 )
nHorz := Int( nHorz / 8 )
lDouble := ( nPrs > 0 )
ldone := Seconds() - nStart >= nInterval .OR. lDouble
@@ -111,11 +111,11 @@ FUNCTION FT_MCONOFF( nTop, nLeft, nBottom, nRight )
// Fill the registers
/*
aReg[ AX ]:=16
aReg[ DX ]:=nTop*8
aReg[ CX ]:=nLeft*8
aReg[DI]:=nBottom*8
aReg[SI]:=nRight*8
aReg[ AX ] := 16
aReg[ DX ] := nTop * 8
aReg[ CX ] := nLeft * 8
aReg[ DI ] := nBottom * 8
aReg[ SI ] := nRight * 8
FT_INT86( 51, aReg ) // execute mouse interrupt
*/
_mse_conoff( nTop * 8, nLeft * 8, nBottom * 8, nRight * 8 )

View File

@@ -36,10 +36,10 @@
/*
here's the board array -- structure of which is:
board_[xx, 1] - subarray containing box coordinates for this peg
board_[xx, 2] - subarray containing all adjacent locations
board_[xx, 3] - subarray containing all target locations
board_[xx, 4] - is the location occupied or not? .T. -> Yes, .F. -> No
board_[ xx, 1 ] - subarray containing box coordinates for this peg
board_[ xx, 2 ] - subarray containing all adjacent locations
board_[ xx, 3 ] - subarray containing all target locations
board_[ xx, 4 ] - is the location occupied or not? .T. -> Yes, .F. -> No
*/
FUNCTION FT_PEGS()
@@ -50,38 +50,38 @@ FUNCTION FT_PEGS()
LOCAL GetList
LOCAL board_ := {;
{ { 0, 29, 2, 34 }, { 2, 4 }, { 3, 9 }, .T. } , ;
{ { 0, 29, 2, 34 }, { 2, 4 }, { 3, 9 }, .T. }, ;
{ { 0, 37, 2, 42 }, { 5 }, { 10 }, .T. } , ;
{ { 0, 45, 2, 50 }, { 2, 6 }, { 1, 11 }, .T. } , ;
{ { 3, 29, 5, 34 }, { 5, 9 }, { 6, 16 }, .T. } , ;
{ { 3, 37, 5, 42 }, { 10 }, { 17 }, .T. } , ;
{ { 3, 45, 5, 50 }, { 5, 11 }, { 4, 18 }, .T. } , ;
{ { 6, 13, 8, 18 }, { 8, 14 }, { 9, 21 }, .T. } , ;
{ { 6, 21, 8, 26 }, { 9, 15 }, { 10, 22 }, .T. } , ;
{ { 6, 29, 8, 34 }, { 4, 8, 10, 16 }, { 1, 7, 11, 23 }, .T. } , ;
{ { 6, 37, 8, 42 }, { 5, 9, 11, 17 }, { 2, 8, 12, 24 }, .T. } , ;
{ { 6, 45, 8, 50 }, { 6, 10, 12, 18 }, { 3, 9, 13, 25 }, .T. } , ;
{ { 6, 53, 8, 58 }, { 11, 19 }, { 10, 26 }, .T. } , ;
{ { 6, 61, 8, 66 }, { 12, 20 }, { 11, 27 }, .T. } , ;
{ { 9, 13, 11, 18 }, { 15 }, { 16 }, .T. } , ;
{ { 9, 21, 11, 26 }, { 16 }, { 17 }, .T. } , ;
{ { 9, 29, 11, 34 }, { 9, 15, 17, 23 }, { 4, 14, 18, 28 }, .T. } , ;
{ { 9, 37, 11, 42 }, { 10, 16, 18, 24 }, { 5, 15, 19, 29 }, .F. } , ;
{ { 9, 45, 11, 50 }, { 11, 17, 19, 25 }, { 6, 16, 20, 30 }, .T. } , ;
{ { 9, 53, 11, 58 }, { 18 }, { 17 }, .T. } , ;
{ { 9, 61, 11, 66 }, { 19 }, { 18 }, .T. } , ;
{ { 12, 13, 14, 18 }, { 14, 22 }, { 7, 23 }, .T. } , ;
{ { 12, 21, 14, 26 }, { 15, 23 }, { 8, 24 }, .T. } , ;
{ { 12, 29, 14, 34 }, { 16, 22, 24, 28 }, { 9, 21, 25, 31 }, .T. } , ;
{ { 12, 37, 14, 42 }, { 17, 23, 25, 29 }, { 10, 22, 26, 32 }, .T. } , ;
{ { 12, 45, 14, 50 }, { 18, 24, 26, 30 }, { 11, 23, 27, 33 }, .T. } , ;
{ { 12, 53, 14, 58 }, { 19, 25 }, { 12, 24 }, .T. } , ;
{ { 12, 61, 14, 66 }, { 20, 26 }, { 13, 25 }, .T. } , ;
{ { 15, 29, 17, 34 }, { 23, 29 }, { 16, 30 }, .T. } , ;
{ { 15, 37, 17, 42 }, { 24 }, { 17 }, .T. } , ;
{ { 15, 45, 17, 50 }, { 25, 29 }, { 18, 28 }, .T. } , ;
{ { 18, 29, 20, 34 }, { 28, 32 }, { 23, 33 }, .T. } , ;
{ { 18, 37, 20, 42 }, { 29 }, { 24 }, .T. } , ;
{ { 0, 45, 2, 50 }, { 2, 6 }, { 1, 11 }, .T. }, ;
{ { 3, 29, 5, 34 }, { 5, 9 }, { 6, 16 }, .T. }, ;
{ { 3, 37, 5, 42 }, { 10 }, { 17 }, .T. }, ;
{ { 3, 45, 5, 50 }, { 5, 11 }, { 4, 18 }, .T. }, ;
{ { 6, 13, 8, 18 }, { 8, 14 }, { 9, 21 }, .T. }, ;
{ { 6, 21, 8, 26 }, { 9, 15 }, { 10, 22 }, .T. }, ;
{ { 6, 29, 8, 34 }, { 4, 8, 10, 16 }, { 1, 7, 11, 23 }, .T. }, ;
{ { 6, 37, 8, 42 }, { 5, 9, 11, 17 }, { 2, 8, 12, 24 }, .T. }, ;
{ { 6, 45, 8, 50 }, { 6, 10, 12, 18 }, { 3, 9, 13, 25 }, .T. }, ;
{ { 6, 53, 8, 58 }, { 11, 19 }, { 10, 26 }, .T. }, ;
{ { 6, 61, 8, 66 }, { 12, 20 }, { 11, 27 }, .T. }, ;
{ { 9, 13, 11, 18 }, { 15 }, { 16 }, .T. }, ;
{ { 9, 21, 11, 26 }, { 16 }, { 17 }, .T. }, ;
{ { 9, 29, 11, 34 }, { 9, 15, 17, 23 }, { 4, 14, 18, 28 }, .T. }, ;
{ { 9, 37, 11, 42 }, { 10, 16, 18, 24 }, { 5, 15, 19, 29 }, .F. }, ;
{ { 9, 45, 11, 50 }, { 11, 17, 19, 25 }, { 6, 16, 20, 30 }, .T. }, ;
{ { 9, 53, 11, 58 }, { 18 }, { 17 }, .T. }, ;
{ { 9, 61, 11, 66 }, { 19 }, { 18 }, .T. }, ;
{ { 12, 13, 14, 18 }, { 14, 22 }, { 7, 23 }, .T. }, ;
{ { 12, 21, 14, 26 }, { 15, 23 }, { 8, 24 }, .T. }, ;
{ { 12, 29, 14, 34 }, { 16, 22, 24, 28 }, { 9, 21, 25, 31 }, .T. }, ;
{ { 12, 37, 14, 42 }, { 17, 23, 25, 29 }, { 10, 22, 26, 32 }, .T. }, ;
{ { 12, 45, 14, 50 }, { 18, 24, 26, 30 }, { 11, 23, 27, 33 }, .T. }, ;
{ { 12, 53, 14, 58 }, { 19, 25 }, { 12, 24 }, .T. }, ;
{ { 12, 61, 14, 66 }, { 20, 26 }, { 13, 25 }, .T. }, ;
{ { 15, 29, 17, 34 }, { 23, 29 }, { 16, 30 }, .T. }, ;
{ { 15, 37, 17, 42 }, { 24 }, { 17 }, .T. }, ;
{ { 15, 45, 17, 50 }, { 25, 29 }, { 18, 28 }, .T. }, ;
{ { 18, 29, 20, 34 }, { 28, 32 }, { 23, 33 }, .T. }, ;
{ { 18, 37, 20, 42 }, { 29 }, { 24 }, .T. }, ;
{ { 18, 45, 20, 50 }, { 30, 32 }, { 25, 31 }, .T. } }
/*
@@ -198,7 +198,7 @@ STATIC FUNCTION err_msg( msg )
STATIC FUNCTION moremoves( board_ )
LOCAL xx, yy, canmove := .F. , piecesleft := 0, buffer
LOCAL xx, yy, canmove := .F., piecesleft := 0, buffer
FOR xx := 1 TO 33
FOR yy := 1 TO Len( board_[ xx ][ 2 ] )

View File

@@ -255,7 +255,7 @@ FUNCTION FT_Adder()
hb_DispOutAt( 21 + nTopOS, 8 + nTapeSpace, " " + /* LOW-ASCII "↑↓" */ Chr( 24 ) + Chr( 25 ) + "-SCROLL <ESC>-QUIT " )
SetColor( "N/W,W+/N" )
lAC_exit_ok := .F.
AChoice( 5 + nTopOS, 7 + nTapeSpace, 20 + nTopOS, 32 + nTapeSpace, aTrans, .T. , ;
AChoice( 5 + nTopOS, 7 + nTapeSpace, 20 + nTopOS, 32 + nTapeSpace, aTrans, .T., ;
{| nMode, cur_elem, rel_pos | _ftAdderTapeUDF( nMode, cur_elem, rel_pos, @lAC_exit_ok ) }, nTotTran, 20 )
SetColor( "R+/W" )
hb_DispBox( 21 + nTopOS, 8 + nTapeSpace, 21 + nTopOS, 30 + nTapeSpace, HB_B_SINGLE_UNI )
@@ -429,7 +429,7 @@ STATIC FUNCTION _ftDispTotal( aAdder )
_ftError( "that number is to big to display! I believe the answer was " + ;
cTotStr + "." )
lAddError := .T.
_ftUpdateTrans( aAdder, .T. , NIL )
_ftUpdateTrans( aAdder, .T., NIL )
_ftClearAdder( aAdder )
nTotal := 0
nNumTotal := 0
@@ -463,7 +463,7 @@ STATIC FUNCTION _ftDispSubTot( aAdder )
_ftError( "that number is to big to display! I believe the answer was " + ;
cStotStr + "." )
lAddError := .T.
_ftUpdateTrans( aAdder, .T. , nNumTotal )
_ftUpdateTrans( aAdder, .T., nNumTotal )
_ftClearAdder( aAdder )
nTotal := 0
nNumTotal := 0
@@ -544,7 +544,7 @@ STATIC FUNCTION _ftAddTotal( aAdder )
_ftSetWinColor( W_CURR, W_SCREEN )
hb_DispOutAt( 6 + nTopOS, 18 + nAddSpace, " <TOTAL>" )
_ftSetWinColor( W_CURR, W_PROMPT )
_ftUpdateTrans( aAdder, .T. , NIL )
_ftUpdateTrans( aAdder, .T., NIL )
_ftDispTotal( aAdder )
lSubRtn := .F. // pressed the total key reset everyting
nSavTotal := nTotal
@@ -563,7 +563,7 @@ STATIC FUNCTION _ftAddTotal( aAdder )
ENDIF
IF _ftRoundIt( nNumTotal, nMaxDeci ) != 0
lSubRtn := .F.
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
ENDIF
IF !lMultDiv
lSubRtn := .T. // total key
@@ -590,14 +590,14 @@ STATIC FUNCTION _ftAddTotal( aAdder )
lSubRtn := .F. // pressed total so key reset everything
IF ! lTotalOk // If you haven't printed total DO-IT
lTotalOk := .T.
_ftUpdateTrans( aAdder, .F. , NIL )
_ftUpdateTrans( aAdder, .F., NIL )
ENDIF
nNumTotal := 0
nSavTotal := nTotal
nTotal := 0
ELSE
IF ! lTotalOk // If you haven't printed total DO-IT
_ftUpdateTrans( aAdder, .F. , NIL )
_ftUpdateTrans( aAdder, .F., NIL )
nNumTotal := 0
ENDIF
ENDIF
@@ -637,7 +637,7 @@ STATIC FUNCTION _ftAddSub( aAdder, nKey )
IF !lNewNum // They pressed + again to add the same
nNumTotal := nSavSubTot // number without re-entering
ENDIF
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
nTotal := nTotal + nNumTotal
lNewNum := .F.
nSavSubTot := nNumTotal // Save this number in case they just press + or -
@@ -648,7 +648,7 @@ STATIC FUNCTION _ftAddSub( aAdder, nKey )
nNumTotal := nSavSubTot // number without re-entering
lNewNum := .T.
ENDIF
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
nTotal := nTotal - nNumTotal
lNewNum := .F.
nSavSubTot := nNumTotal // Save this number in case they just press + or -
@@ -689,22 +689,22 @@ STATIC FUNCTION _ftMultDiv( aAdder, nKey )
IF _ftRoundIt( nTotal, nMaxDeci ) == 0
IF nKey == hb_keyCode( "*" ) // Setup mode
nAddMode := 3
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
ELSEIF nKey == hb_keyCode( "/" )
nAddMode := 4
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
ENDIF
nTotal := nNumTotal
nNumTotal := 0
ELSE
IF nKey == hb_keyCode( "*" ) // Multiply
nAddMode := 3
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
nTotal := nTotal * nNumTotal
nNumTotal := 0
ELSEIF nKey == hb_keyCode( "/" ) // Divide
nAddMode := 4
_ftUpdateTrans( aAdder, .F. , nNumTotal )
_ftUpdateTrans( aAdder, .F., nNumTotal )
nTotal := _ftDivide( aAdder, nTotal, nNumTotal )
IF lDivError
_ftError( "you can't divide by ZERO!" )
@@ -751,7 +751,7 @@ STATIC FUNCTION _ftAddHelp
" <ESC> - Quit" + hb_eol() + ;
" <F10> - return a <TOTAL> to the active get"
_ftPushMessage( cMess, .T. , "ADDER HELP", "press any key to continue...", ;
_ftPushMessage( cMess, .T., "ADDER HELP", "press any key to continue...", ;
"QUIET" )
RETURN NIL
@@ -777,7 +777,7 @@ STATIC FUNCTION _ftClearAdder( aAdder )
IF lClAdder // If it has alredy been pressed once
nTotal := 0 // then we are clearing the total
nSavTotal := 0
_ftUpdateTrans( aAdder, .F. , NIL )
_ftUpdateTrans( aAdder, .F., NIL )
lClAdder := .F.
_ftDispTotal( aAdder )
ELSE
@@ -1086,7 +1086,7 @@ STATIC FUNCTION _ftPushMessage( cMessage, lWait, cTitle, cBotTitle, xQuiet, nTop
nBottom := nTop + nNumRows + 2
nLeft := Int( ( MaxCol() - nWide ) / 2 ) - 3
nRight := nLeft + nWide + 4
lWait := iif( lWait == NIL, .F. , lWait )
lWait := iif( lWait == NIL, .F., lWait )
_ftPushWin( nTop, nLeft, nBottom, nRight, cTitle, cBotTitle, nWinColor )
DISPMESSAGE cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2
@@ -1296,7 +1296,7 @@ STATIC FUNCTION _ftError( cMessage, xDontReset )
LOCAL nOldRow, nOldCol, nOldCurs, nTop, nLeft, nBot, nRight, cOldColor
LOCAL nOldLastKey, cErrorScr, nMessLen, nWide, nNumRows, nKey
LOCAL cOldDevic, lOldPrint
LOCAL lResetLKey := iif( xDontReset == NIL, .T. , .F. )
LOCAL lResetLKey := iif( xDontReset == NIL, .T., .F. )
nOldLastKey := LastKey()
nOldRow := Row()
@@ -1354,7 +1354,7 @@ STATIC FUNCTION _ftStuffComma( cStrToStuff, lTrimStuffedStr )
LOCAL nDecPosit, x
lTrimStuffedStr := iif( lTrimStuffedStr == NIL, .F. , lTrimStuffedStr )
lTrimStuffedStr := iif( lTrimStuffedStr == NIL, .F., lTrimStuffedStr )
IF !( "." $ cStrToStuff )
cStrToStuff := _ftPosIns( cStrToStuff, ".", iif( "C" $ cStrToStuff .OR. ;
"E" $ cStrToStuff .OR. "+" $ cStrToStuff .OR. "-" $ cStrToStuff ;

View File

@@ -62,7 +62,7 @@ FUNCTION FT_TEMPFIL( cPath, lHide, nHandle )
LOCAL cRet, aRegs[ 3 ]
cPath := iif( ! HB_ISSTRING( cPath ), ;
Replicate( hb_BChar( 0 ), 13 ) , ;
Replicate( hb_BChar( 0 ), 13 ), ;
cPath += Replicate( hb_BChar( 0 ), 13 ) )
lHide := iif( HB_ISLOGICAL( lHide ), lHide, .F. )

View File

@@ -35,7 +35,7 @@ PROCEDURE Main()
? PadR( "FT_AADDITION( aList1, aList2, , .F. ) ->", 44 )
AEval( var0, {| x | QQOut( x + "," ) } )
?
var0 := FT_AADDITION( aList1, aList2, .F. , .F. )
var0 := FT_AADDITION( aList1, aList2, .F., .F. )
? PadR( "FT_AADDITION( aList1, aList2, .F., .F. ) ->", 44 )
AEval( var0, {| x | QQOut( x + "," ) } )
?

View File

@@ -19,7 +19,7 @@ PROCEDURE Main()
ft_numlock( .F. )
ENDIF
hb_keyPut( K_F1 )
aRet := ft_calendar( 10, 40, "w+/rb", .T. , .T. ) // display calendar, return all.
aRet := ft_calendar( 10, 40, "w+/rb", .T., .T. ) // display calendar, return all.
@ 1, 0 SAY "Date :" + DToC( aRet[ 1 ] )
@ 2, 0 SAY "Month Number:" + Str( aRet[ 2 ], 2, 0 )
@ 3, 0 SAY "Day Number :" + Str( aRet[ 3 ], 2, 0 )

View File

@@ -24,7 +24,7 @@ PROCEDURE Main( cVidMode )
IF "EGA" $ Upper( cVidMode )
SetMode( 43, 80 )
ENDIF
lColour := iif( "MONO" $ Upper( cVidMode ), .F. , IsColor() )
lColour := iif( "MONO" $ Upper( cVidMode ), .F., IsColor() )
SET SCOREBOARD OFF
SetCursor( SC_NONE )

View File

@@ -28,10 +28,10 @@ PROCEDURE Main()
cNormH := iif( lColor, "W+/BG", "W+/N" )
cNormN := iif( lColor, "N/BG" , "W/N" )
cWindH := iif( lColor, "W+/B", "W+/N" )
cWindN := iif( lColor, "W/B" , "W/N" )
cErrH := iif( lColor, "W+/R", "W+/N" )
cErrN := iif( lColor, "W/R" , "W/N" )
cWindH := iif( lColor, "W+/B" , "W+/N" )
cWindN := iif( lColor, "W/B" , "W/N" )
cErrH := iif( lColor, "W+/R" , "W+/N" )
cErrN := iif( lColor, "W/R" , "W/N" )
cDosScrn := SaveScreen()
nDosRow := Row()

View File

@@ -13,12 +13,12 @@ PROCEDURE Main( cCk, cStr, nOcc, xCase )
QUIT
ENDIF
xCase := iif( xCase == "Y", .T. , .F. )
xCase := iif( xCase == "Y", .T., .F. )
nOcc := Val( nOcc )
? iif( xCase, "Ignoring ", "Observing " ) + "case:"
? cStr
nFind := FT_FINDITH( cCk, cStr, nOcc, xCase )
? iif( nFind > 0, Space( nFind - 1 ) + "^" , "Not found" )
? iif( nFind > 0, Space( nFind - 1 ) + "^", "Not found" )
RETURN

View File

@@ -31,7 +31,7 @@ PROCEDURE Main( cCmdLine )
cCmdLine := iif( cCmdLine == NIL, "", cCmdLine )
lColor := iif( "MONO" $ Upper( cCmdLine ), .F. , IsColor() )
lColor := iif( "MONO" $ Upper( cCmdLine ), .F., IsColor() )
// Border, Box, Bar, Current, Unselected
aColors := iif( lColor, { "W+/G", "N/G", "N/G", "N/W", "N+/G" }, ;

View File

@@ -16,7 +16,7 @@
PROCEDURE Main()
LOCAL aFields := {}, cKey := "O", cOldColor
LOCAL nFreeze := 1, lSaveScrn := .T. , nRecSel
LOCAL nFreeze := 1, lSaveScrn := .T., nRecSel
LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R"
LOCAL cColorShad := "N/N"
LOCAL GetList := {}
@@ -93,11 +93,11 @@ STATIC FUNCTION make_dbf()
{ "SUGARMAN", "CANDY", "1541 SWEETHEART ROAD", "HERSHEY", "PA", "10132" } }
dbCreate( "TBNAMES", {;
{ "LAST ", "C", 18, 0, } , ;
{ "FIRST", "C", 9, 0, } , ;
{ "ADDR ", "C", 28, 0, } , ;
{ "CITY ", "C", 21, 0, } , ;
{ "STATE", "C", 2, 0, } , ;
{ "LAST ", "C", 18, 0, }, ;
{ "FIRST", "C", 9, 0, }, ;
{ "ADDR ", "C", 28, 0, }, ;
{ "CITY ", "C", 21, 0, }, ;
{ "STATE", "C", 2, 0, }, ;
{ "ZIP ", "C", 9, 0, } } )
USE tbnames
FOR x := 1 TO Len( aData )

View File

@@ -7,22 +7,22 @@
PROCEDURE Main()
LOCAL datamenu := { ;
{ "Customers", , {|| cust() } } , ;
{ "Invoices", , {|| inv() } } , ;
{ "Customers", , {|| cust() } }, ;
{ "Invoices", , {|| inv() } }, ;
{ "Vendors", , {|| vendors() } }, ;
{ "Exit", "Return to Main Menu" } }
LOCAL repmenu := { ;
{ "Customer List", , {|| custrep() } } , ;
{ "Past Due", , {|| pastdue() } } , ;
{ "Customer List", , {|| custrep() } }, ;
{ "Past Due", , {|| pastdue() } }, ;
{ "Weekly Sales", , {|| weeksales() } }, ;
{ "Monthly P&L", , {|| monthpl() } } , ;
{ "Monthly P&L", , {|| monthpl() } }, ;
{ "Vendor List", , {|| vendorrep() } }, ;
{ "Exit", "Return to Main Menu" } }
LOCAL maintmenu := { ;
{ "Reindex", "Rebuild index files", {|| re_ntx() } } , ;
{ "Backup", "Backup data files" , {|| backup() } } , ;
{ "Reindex", "Rebuild index files", {|| re_ntx() } }, ;
{ "Backup", "Backup data files" , {|| backup() } }, ;
{ "Compress", "Compress data files", {|| compress() } }, ;
{ "Exit", "Return to Main Menu" } }

View File

@@ -80,7 +80,8 @@
#include "hbsqlit3.ch"
PROCEDURE main()
PROCEDURE Main()
LOCAL cFile := ":memory:"
LOCAL cSQLTEXT
LOCAL pDb, cb
@@ -111,14 +112,16 @@ PROCEDURE main()
? cErrorMsg( sqlite3_exec( pDb, cSQLTEXT, cb ), .F. )
sqlite3_sleep( 3000 )
//
pDb := NIL // close database
pDb := NIL // close database
RETURN
/**
*/
FUNCTION Authorizer( nAction, cName1, cName2, cDatabaseName, cTriggerOrViewName )
LOCAL oldColor := SetColor( "R/N" )
? "=>", StrZero( nAction, 2 ), cName1, cName2, cDatabaseName, cTriggerOrViewName
@@ -129,7 +132,9 @@ FUNCTION Authorizer( nAction, cName1, cName2, cDatabaseName, cTriggerOrViewName
/**
*/
FUNCTION Authorizer2( nAction, cName1, cName2, cDatabaseName, cTriggerOrViewName )
LOCAL oldColor := SetColor( "R/N" )
? "=>", StrZero( nAction, 2 ), cName1, cName2, cDatabaseName, cTriggerOrViewName
@@ -140,6 +145,7 @@ FUNCTION Authorizer2( nAction, cName1, cName2, cDatabaseName, cTriggerOrViewName
/**
*/
FUNCTION Authorizer3( nAction, cName1, cName2, cDatabaseName, cTriggerOrViewName )
HB_SYMBOL_UNUSED( cName1 )
@@ -151,12 +157,14 @@ FUNCTION Authorizer3( nAction, cName1, cName2, cDatabaseName, cTriggerOrViewName
/**
*/
FUNCTION CallBack( nColCount, aValue, aColName )
LOCAL nI
LOCAL oldColor := SetColor( "G/N" )
FOR nI := 1 TO nColCount
? Padr( aColName[ nI ], 5 ) , " == ", aValue[ nI ]
? PadR( aColName[ nI ], 5 ), " == ", aValue[ nI ]
NEXT
SetColor( oldColor )
@@ -165,37 +173,39 @@ FUNCTION CallBack( nColCount, aValue, aColName )
/**
*/
STATIC FUNCTION cErrorMsg( nError, lShortMsg )
LOCAL aErrorCodes := { ;
{ SQLITE_ERROR , "SQLITE_ERROR" , "SQL error or missing database" }, ;
{ SQLITE_INTERNAL , "SQLITE_INTERNAL" , "NOT USED. Internal logic error in SQLite" }, ;
{ SQLITE_PERM , "SQLITE_PERM" , "Access permission denied" }, ;
{ SQLITE_ABORT , "SQLITE_ABORT" , "Callback routine requested an abort" }, ;
{ SQLITE_BUSY , "SQLITE_BUSY" , "The database file is locked" }, ;
{ SQLITE_LOCKED , "SQLITE_LOCKED" , "A table in the database is locked" }, ;
{ SQLITE_NOMEM , "SQLITE_NOMEM" , "A malloc() failed" }, ;
{ SQLITE_READONLY , "SQLITE_READONLY" , "Attempt to write a readonly database" }, ;
{ SQLITE_INTERRUPT , "SQLITE_INTERRUPT" , "Operation terminated by sqlite3_interrupt()" }, ;
{ SQLITE_IOERR , "SQLITE_IOERR" , "Some kind of disk I/O error occurred" }, ;
{ SQLITE_CORRUPT , "SQLITE_CORRUPT" , "The database disk image is malformed" }, ;
{ SQLITE_NOTFOUND , "SQLITE_NOTFOUND" , "NOT USED. Table or record not found" }, ;
{ SQLITE_FULL , "SQLITE_FULL" , "Insertion failed because database is full" }, ;
{ SQLITE_CANTOPEN , "SQLITE_CANTOPEN" , "Unable to open the database file" }, ;
{ SQLITE_PROTOCOL , "SQLITE_PROTOCOL" , "NOT USED. Database lock protocol error" }, ;
{ SQLITE_EMPTY , "SQLITE_EMPTY" , "Database is empty" }, ;
{ SQLITE_SCHEMA , "SQLITE_SCHEMA" , "The database schema changed" }, ;
{ SQLITE_TOOBIG , "SQLITE_TOOBIG" , "String or BLOB exceeds size limit" }, ;
{ SQLITE_CONSTRAINT , "SQLITE_CONSTRAINT" , "Abort due to constraint violation" }, ;
{ SQLITE_MISMATCH , "SQLITE_MISMATCH" , "Data type mismatch" }, ;
{ SQLITE_MISUSE , "SQLITE_MISUSE" , "Library used incorrectly" }, ;
{ SQLITE_NOLFS , "SQLITE_NOLFS" , "Uses OS features not supported on host" }, ;
{ SQLITE_AUTH , "SQLITE_AUTH" , "Authorization denied" }, ;
{ SQLITE_FORMAT , "SQLITE_FORMAT" , "Auxiliary database format error" }, ;
{ SQLITE_RANGE , "SQLITE_RANGE" , "2nd parameter to sqlite3_bind out of range" }, ;
{ SQLITE_NOTADB , "SQLITE_NOTADB" , "File opened that is not a database file" }, ;
{ SQLITE_ROW , "SQLITE_ROW" , "sqlite3_step() has another row ready" }, ;
{ SQLITE_DONE , "SQLITE_DONE" , "sqlite3_step() has finished executing" } ;
}, nIndex, cErrorMsg := "UNKNOWN"
{ SQLITE_ERROR, "SQLITE_ERROR", "SQL error or missing database" }, ;
{ SQLITE_INTERNAL, "SQLITE_INTERNAL", "NOT USED. Internal logic error in SQLite" }, ;
{ SQLITE_PERM, "SQLITE_PERM", "Access permission denied" }, ;
{ SQLITE_ABORT, "SQLITE_ABORT", "Callback routine requested an abort" }, ;
{ SQLITE_BUSY, "SQLITE_BUSY", "The database file is locked" }, ;
{ SQLITE_LOCKED, "SQLITE_LOCKED", "A table in the database is locked" }, ;
{ SQLITE_NOMEM, "SQLITE_NOMEM", "A malloc() failed" }, ;
{ SQLITE_READONLY, "SQLITE_READONLY", "Attempt to write a readonly database" }, ;
{ SQLITE_INTERRUPT, "SQLITE_INTERRUPT", "Operation terminated by sqlite3_interrupt()" }, ;
{ SQLITE_IOERR, "SQLITE_IOERR", "Some kind of disk I/O error occurred" }, ;
{ SQLITE_CORRUPT, "SQLITE_CORRUPT", "The database disk image is malformed" }, ;
{ SQLITE_NOTFOUND, "SQLITE_NOTFOUND", "NOT USED. Table or record not found" }, ;
{ SQLITE_FULL, "SQLITE_FULL", "Insertion failed because database is full" }, ;
{ SQLITE_CANTOPEN, "SQLITE_CANTOPEN", "Unable to open the database file" }, ;
{ SQLITE_PROTOCOL, "SQLITE_PROTOCOL", "NOT USED. Database lock protocol error" }, ;
{ SQLITE_EMPTY, "SQLITE_EMPTY", "Database is empty" }, ;
{ SQLITE_SCHEMA, "SQLITE_SCHEMA", "The database schema changed" }, ;
{ SQLITE_TOOBIG, "SQLITE_TOOBIG", "String or BLOB exceeds size limit" }, ;
{ SQLITE_CONSTRAINT, "SQLITE_CONSTRAINT", "Abort due to constraint violation" }, ;
{ SQLITE_MISMATCH, "SQLITE_MISMATCH", "Data type mismatch" }, ;
{ SQLITE_MISUSE, "SQLITE_MISUSE", "Library used incorrectly" }, ;
{ SQLITE_NOLFS, "SQLITE_NOLFS", "Uses OS features not supported on host" }, ;
{ SQLITE_AUTH, "SQLITE_AUTH", "Authorization denied" }, ;
{ SQLITE_FORMAT, "SQLITE_FORMAT", "Auxiliary database format error" }, ;
{ SQLITE_RANGE, "SQLITE_RANGE", "2nd parameter to sqlite3_bind out of range" }, ;
{ SQLITE_NOTADB, "SQLITE_NOTADB", "File opened that is not a database file" }, ;
{ SQLITE_ROW, "SQLITE_ROW", "sqlite3_step() has another row ready" }, ;
{ SQLITE_DONE, "SQLITE_DONE", "sqlite3_step() has finished executing" } ;
}, nIndex, cErrorMsg := "UNKNOWN"
hb_default( @lShortMsg, .T. )
@@ -203,7 +213,7 @@ STATIC FUNCTION cErrorMsg( nError, lShortMsg )
IF nError == 0
cErrorMsg := "SQLITE_OK"
ELSE
nIndex := AScan( aErrorCodes, {| x | x[ 1 ] == nError } )
nIndex := AScan( aErrorCodes, {| x | x[ 1 ] == nError } )
cErrorMsg := iif( nIndex > 0, aErrorCodes[ nIndex ][ iif( lShortMsg, 2, 3 ) ], cErrorMsg )
ENDIF
ENDIF
@@ -212,16 +222,18 @@ STATIC FUNCTION cErrorMsg( nError, lShortMsg )
/**
*/
STATIC FUNCTION PrepareDB( cFile )
LOCAL cSQLTEXT, cMsg
LOCAL pDb, pStmt
LOCAL hPerson := { ;
"Bob" => 52, ;
"Fred" => 32, ;
"Sasha" => 17, ;
"Andy" => 20, ;
"Ivet" => 28 ;
}, enum
"Bob" => 52, ;
"Fred" => 32, ;
"Sasha" => 17, ;
"Andy" => 20, ;
"Ivet" => 28 ;
}, enum
pDb := sqlite3_open( cFile, .T. )
IF Empty( pDb )
@@ -239,7 +251,7 @@ STATIC FUNCTION PrepareDB( cFile )
RETURN NIL
ENDIF
//
cSQLTEXT := "INSERT INTO person( name, age, pasw ) VALUES( :name, :age, :pasw )"
pStmt := sqlite3_prepare( pDb, cSQLTEXT )
IF Empty( pStmt )
@@ -253,7 +265,7 @@ STATIC FUNCTION PrepareDB( cFile )
sqlite3_reset( pStmt )
sqlite3_bind_text( pStmt, 1, enum:__enumKey() )
sqlite3_bind_int( pStmt, 2, enum:__enumValue() )
sqlite3_bind_text( pStmt, 3, hb_md5( enum:__enumKey() ) )
sqlite3_bind_text( pStmt, 3, hb_MD5( enum:__enumKey() ) )
sqlite3_step( pStmt )
NEXT

View File

@@ -68,22 +68,23 @@
#include "hbsqlit3.ch"
PROCEDURE main()
PROCEDURE Main()
LOCAL cFileSource := ":memory:", cFileDest := "backup.db", cSQLTEXT
LOCAL pDbSource, pDbDest, pBackup, cb, nDbFlags
//
IF sqlite3_libversion_number() < 3006011
ErrorLevel( 1 )
RETURN
ENDIF
IF Empty( pDbSource := PrepareDB(cFileSource) )
IF Empty( pDbSource := PrepareDB( cFileSource ) )
ErrorLevel( 1 )
RETURN
ENDIF
nDbFlags := SQLITE_OPEN_CREATE + SQLITE_OPEN_READWRITE + ;
SQLITE_OPEN_EXCLUSIVE
SQLITE_OPEN_EXCLUSIVE
pDbDest := sqlite3_open_v2( cFileDest, nDbFlags )
IF Empty( pDbDest )
@@ -94,7 +95,6 @@ PROCEDURE main()
sqlite3_trace( pDbDest, .T., "backup.log" )
//
pBackup := sqlite3_backup_init( pDbDest, "main", pDbSource, "main" )
IF Empty( pBackup )
? "Can't initialize backup"
@@ -110,15 +110,15 @@ PROCEDURE main()
sqlite3_backup_finish( pBackup ) /* !!! */
pDbSource := Nil /* close :memory: database */
pDbSource := NIL /* close :memory: database */
/* Little test for sqlite3_exec with callback */
?
? cSQLTEXT := "SELECT * FROM main.person WHERE age BETWEEN 20 AND 40"
cb := @CallBack() // "CallBack"
? cErrorMsg(sqlite3_exec(pDbDest, cSQLTEXT, cb))
? cErrorMsg( sqlite3_exec( pDbDest, cSQLTEXT, cb ) )
pDbDest := NIL // close database
pDbDest := NIL // close database
sqlite3_sleep( 3000 )
@@ -126,12 +126,14 @@ PROCEDURE main()
/**
*/
FUNCTION CallBack( nColCount, aValue, aColName )
LOCAL nI
LOCAL oldColor := SetColor( "G/N" )
FOR nI := 1 TO nColCount
? Padr( aColName[ nI ], 5 ) , " == ", aValue[ nI ]
? PadR( aColName[ nI ], 5 ), " == ", aValue[ nI ]
NEXT
SetColor( oldColor )
@@ -140,37 +142,39 @@ FUNCTION CallBack( nColCount, aValue, aColName )
/**
*/
STATIC FUNCTION cErrorMsg( nError, lShortMsg )
LOCAL aErrorCodes := { ;
{ SQLITE_ERROR , "SQLITE_ERROR" , "SQL error or missing database" }, ;
{ SQLITE_INTERNAL , "SQLITE_INTERNAL" , "NOT USED. Internal logic error in SQLite" }, ;
{ SQLITE_PERM , "SQLITE_PERM" , "Access permission denied" }, ;
{ SQLITE_ABORT , "SQLITE_ABORT" , "Callback routine requested an abort" }, ;
{ SQLITE_BUSY , "SQLITE_BUSY" , "The database file is locked" }, ;
{ SQLITE_LOCKED , "SQLITE_LOCKED" , "A table in the database is locked" }, ;
{ SQLITE_NOMEM , "SQLITE_NOMEM" , "A malloc() failed" }, ;
{ SQLITE_READONLY , "SQLITE_READONLY" , "Attempt to write a readonly database" }, ;
{ SQLITE_INTERRUPT , "SQLITE_INTERRUPT" , "Operation terminated by sqlite3_interrupt()" }, ;
{ SQLITE_IOERR , "SQLITE_IOERR" , "Some kind of disk I/O error occurred" }, ;
{ SQLITE_CORRUPT , "SQLITE_CORRUPT" , "The database disk image is malformed" }, ;
{ SQLITE_NOTFOUND , "SQLITE_NOTFOUND" , "NOT USED. Table or record not found" }, ;
{ SQLITE_FULL , "SQLITE_FULL" , "Insertion failed because database is full" }, ;
{ SQLITE_CANTOPEN , "SQLITE_CANTOPEN" , "Unable to open the database file" }, ;
{ SQLITE_PROTOCOL , "SQLITE_PROTOCOL" , "NOT USED. Database lock protocol error" }, ;
{ SQLITE_EMPTY , "SQLITE_EMPTY" , "Database is empty" }, ;
{ SQLITE_SCHEMA , "SQLITE_SCHEMA" , "The database schema changed" }, ;
{ SQLITE_TOOBIG , "SQLITE_TOOBIG" , "String or BLOB exceeds size limit" }, ;
{ SQLITE_CONSTRAINT , "SQLITE_CONSTRAINT" , "Abort due to constraint violation" }, ;
{ SQLITE_MISMATCH , "SQLITE_MISMATCH" , "Data type mismatch" }, ;
{ SQLITE_MISUSE , "SQLITE_MISUSE" , "Library used incorrectly" }, ;
{ SQLITE_NOLFS , "SQLITE_NOLFS" , "Uses OS features not supported on host" }, ;
{ SQLITE_AUTH , "SQLITE_AUTH" , "Authorization denied" }, ;
{ SQLITE_FORMAT , "SQLITE_FORMAT" , "Auxiliary database format error" }, ;
{ SQLITE_RANGE , "SQLITE_RANGE" , "2nd parameter to sqlite3_bind out of range" }, ;
{ SQLITE_NOTADB , "SQLITE_NOTADB" , "File opened that is not a database file" }, ;
{ SQLITE_ROW , "SQLITE_ROW" , "sqlite3_step() has another row ready" }, ;
{ SQLITE_DONE , "SQLITE_DONE" , "sqlite3_step() has finished executing" } ;
}, nIndex, cErrorMsg := "UNKNOWN"
{ SQLITE_ERROR, "SQLITE_ERROR", "SQL error or missing database" }, ;
{ SQLITE_INTERNAL, "SQLITE_INTERNAL", "NOT USED. Internal logic error in SQLite" }, ;
{ SQLITE_PERM, "SQLITE_PERM", "Access permission denied" }, ;
{ SQLITE_ABORT, "SQLITE_ABORT", "Callback routine requested an abort" }, ;
{ SQLITE_BUSY, "SQLITE_BUSY", "The database file is locked" }, ;
{ SQLITE_LOCKED, "SQLITE_LOCKED", "A table in the database is locked" }, ;
{ SQLITE_NOMEM, "SQLITE_NOMEM", "A malloc() failed" }, ;
{ SQLITE_READONLY, "SQLITE_READONLY", "Attempt to write a readonly database" }, ;
{ SQLITE_INTERRUPT, "SQLITE_INTERRUPT", "Operation terminated by sqlite3_interrupt()" }, ;
{ SQLITE_IOERR, "SQLITE_IOERR", "Some kind of disk I/O error occurred" }, ;
{ SQLITE_CORRUPT, "SQLITE_CORRUPT", "The database disk image is malformed" }, ;
{ SQLITE_NOTFOUND, "SQLITE_NOTFOUND", "NOT USED. Table or record not found" }, ;
{ SQLITE_FULL, "SQLITE_FULL", "Insertion failed because database is full" }, ;
{ SQLITE_CANTOPEN, "SQLITE_CANTOPEN", "Unable to open the database file" }, ;
{ SQLITE_PROTOCOL, "SQLITE_PROTOCOL", "NOT USED. Database lock protocol error" }, ;
{ SQLITE_EMPTY, "SQLITE_EMPTY", "Database is empty" }, ;
{ SQLITE_SCHEMA, "SQLITE_SCHEMA", "The database schema changed" }, ;
{ SQLITE_TOOBIG, "SQLITE_TOOBIG", "String or BLOB exceeds size limit" }, ;
{ SQLITE_CONSTRAINT, "SQLITE_CONSTRAINT", "Abort due to constraint violation" }, ;
{ SQLITE_MISMATCH, "SQLITE_MISMATCH", "Data type mismatch" }, ;
{ SQLITE_MISUSE, "SQLITE_MISUSE", "Library used incorrectly" }, ;
{ SQLITE_NOLFS, "SQLITE_NOLFS", "Uses OS features not supported on host" }, ;
{ SQLITE_AUTH, "SQLITE_AUTH", "Authorization denied" }, ;
{ SQLITE_FORMAT, "SQLITE_FORMAT", "Auxiliary database format error" }, ;
{ SQLITE_RANGE, "SQLITE_RANGE", "2nd parameter to sqlite3_bind out of range" }, ;
{ SQLITE_NOTADB, "SQLITE_NOTADB", "File opened that is not a database file" }, ;
{ SQLITE_ROW, "SQLITE_ROW", "sqlite3_step() has another row ready" }, ;
{ SQLITE_DONE, "SQLITE_DONE", "sqlite3_step() has finished executing" } ;
}, nIndex, cErrorMsg := "UNKNOWN"
hb_default( @lShortMsg, .T. )
@@ -178,7 +182,7 @@ STATIC FUNCTION cErrorMsg( nError, lShortMsg )
IF nError == 0
cErrorMsg := "SQLITE_OK"
ELSE
nIndex := AScan( aErrorCodes, {| x | x[ 1 ] == nError } )
nIndex := AScan( aErrorCodes, {| x | x[ 1 ] == nError } )
cErrorMsg := iif( nIndex > 0, aErrorCodes[ nIndex ][ iif( lShortMsg, 2, 3 ) ], cErrorMsg )
ENDIF
ENDIF
@@ -187,16 +191,18 @@ STATIC FUNCTION cErrorMsg( nError, lShortMsg )
/**
*/
STATIC FUNCTION PrepareDB( cFile )
LOCAL cSQLTEXT, cMsg
LOCAL pDb, pStmt
LOCAL hPerson := { ;
"Bob" => 52, ;
"Fred" => 32, ;
"Sasha" => 17, ;
"Andy" => 20, ;
"Ivet" => 28 ;
}, enum
"Bob" => 52, ;
"Fred" => 32, ;
"Sasha" => 17, ;
"Andy" => 20, ;
"Ivet" => 28 ;
}, enum
pDb := sqlite3_open( cFile, .T. )
IF Empty( pDb )
@@ -208,7 +214,7 @@ STATIC FUNCTION PrepareDB( cFile )
sqlite3_trace( pDb, .T., "backup.log" )
cSQLTEXT := "CREATE TABLE person( name TEXT, age INTEGER )"
cMsg := cErrorMsg( sqlite3_exec(pDb, cSQLTEXT) )
cMsg := cErrorMsg( sqlite3_exec( pDb, cSQLTEXT ) )
IF !( cMsg == "SQLITE_OK" )
? "Can't create table : person"
@@ -216,7 +222,7 @@ STATIC FUNCTION PrepareDB( cFile )
RETURN NIL
ENDIF
//
cSQLTEXT := "INSERT INTO person( name, age ) VALUES( :name, :age )"
pStmt := sqlite3_prepare( pDb, cSQLTEXT )
IF Empty( pStmt )
@@ -229,7 +235,7 @@ STATIC FUNCTION PrepareDB( cFile )
FOR EACH enum IN hPerson
sqlite3_reset( pStmt )
sqlite3_bind_text( pStmt, 1, enum:__enumKey() )
sqlite3_bind_int( pStmt, 2, enum:__enumValue() )
sqlite3_bind_int( pStmt, 2, enum:__enumValue() )
sqlite3_step( pStmt )
NEXT

View File

@@ -54,7 +54,7 @@
#include "hbsqlit3.ch"
PROCEDURE main()
PROCEDURE Main()
LOCAL cSQLTEXT, cFile := ":memory:"
LOCAL pDb, cb := @CallBack()
@@ -63,7 +63,7 @@ PROCEDURE main()
ErrorLevel( 1 )
RETURN
ENDIF
//
sqlite3_commit_hook( pDb, "HookCommitY" )
? cSQLTEXT := "SELECT * FROM person WHERE name == 'Andy'"
@@ -81,10 +81,10 @@ PROCEDURE main()
? cSQLTEXT := "SELECT * FROM person WHERE name == 'Andy'"
? "return value: ", cErrorMsg( sqlite3_exec( pDb, cSQLTEXT, cb ) )
? Replicate( "-", Len(cSQLTEXT ) )
? Replicate( "-", Len( cSQLTEXT ) )
sqlite3_sleep( 10000 )
//
sqlite3_commit_hook( pDb, @HookCommitN() )
sqlite3_rollback_hook( pDb, @HookRollback() )
@@ -102,7 +102,7 @@ PROCEDURE main()
? cSQLTEXT := "SELECT * FROM person WHERE name == 'Ivet'"
? "return value: ", cErrorMsg( sqlite3_exec( pDb, cSQLTEXT, cb ) )
//
pDb := NIL
sqlite3_sleep( 10000 )
@@ -118,7 +118,7 @@ FUNCTION CallBack( nColCount, aValue, aColName )
LOCAL oldColor := SetColor( "G/N" )
FOR nI := 1 TO nColCount
? PadR( aColName[ nI ], 5 ) , " == ", aValue[ nI ]
? PadR( aColName[ nI ], 5 ), " == ", aValue[ nI ]
NEXT
SetColor( oldColor )
@@ -164,34 +164,34 @@ FUNCTION HookRollback()
STATIC FUNCTION cErrorMsg( nError, lShortMsg )
LOCAL aErrorCodes := { ;
{ SQLITE_ERROR , "SQLITE_ERROR" , "SQL error or missing database" }, ;
{ SQLITE_INTERNAL , "SQLITE_INTERNAL" , "NOT USED. Internal logic error in SQLite" }, ;
{ SQLITE_PERM , "SQLITE_PERM" , "Access permission denied" }, ;
{ SQLITE_ABORT , "SQLITE_ABORT" , "Callback routine requested an abort" }, ;
{ SQLITE_BUSY , "SQLITE_BUSY" , "The database file is locked" }, ;
{ SQLITE_LOCKED , "SQLITE_LOCKED" , "A table in the database is locked" }, ;
{ SQLITE_NOMEM , "SQLITE_NOMEM" , "A malloc() failed" }, ;
{ SQLITE_READONLY , "SQLITE_READONLY" , "Attempt to write a readonly database" }, ;
{ SQLITE_INTERRUPT , "SQLITE_INTERRUPT" , "Operation terminated by sqlite3_interrupt()" }, ;
{ SQLITE_IOERR , "SQLITE_IOERR" , "Some kind of disk I/O error occurred" }, ;
{ SQLITE_CORRUPT , "SQLITE_CORRUPT" , "The database disk image is malformed" }, ;
{ SQLITE_NOTFOUND , "SQLITE_NOTFOUND" , "NOT USED. Table or record not found" }, ;
{ SQLITE_FULL , "SQLITE_FULL" , "Insertion failed because database is full" }, ;
{ SQLITE_CANTOPEN , "SQLITE_CANTOPEN" , "Unable to open the database file" }, ;
{ SQLITE_PROTOCOL , "SQLITE_PROTOCOL" , "NOT USED. Database lock protocol error" }, ;
{ SQLITE_EMPTY , "SQLITE_EMPTY" , "Database is empty" }, ;
{ SQLITE_SCHEMA , "SQLITE_SCHEMA" , "The database schema changed" }, ;
{ SQLITE_TOOBIG , "SQLITE_TOOBIG" , "String or BLOB exceeds size limit" }, ;
{ SQLITE_CONSTRAINT , "SQLITE_CONSTRAINT" , "Abort due to constraint violation" }, ;
{ SQLITE_MISMATCH , "SQLITE_MISMATCH" , "Data type mismatch" }, ;
{ SQLITE_MISUSE , "SQLITE_MISUSE" , "Library used incorrectly" }, ;
{ SQLITE_NOLFS , "SQLITE_NOLFS" , "Uses OS features not supported on host" }, ;
{ SQLITE_AUTH , "SQLITE_AUTH" , "Authorization denied" }, ;
{ SQLITE_FORMAT , "SQLITE_FORMAT" , "Auxiliary database format error" }, ;
{ SQLITE_RANGE , "SQLITE_RANGE" , "2nd parameter to sqlite3_bind out of range" }, ;
{ SQLITE_NOTADB , "SQLITE_NOTADB" , "File opened that is not a database file" }, ;
{ SQLITE_ROW , "SQLITE_ROW" , "sqlite3_step() has another row ready" }, ;
{ SQLITE_DONE , "SQLITE_DONE" , "sqlite3_step() has finished executing" } ;
{ SQLITE_ERROR, "SQLITE_ERROR", "SQL error or missing database" }, ;
{ SQLITE_INTERNAL, "SQLITE_INTERNAL", "NOT USED. Internal logic error in SQLite" }, ;
{ SQLITE_PERM, "SQLITE_PERM", "Access permission denied" }, ;
{ SQLITE_ABORT, "SQLITE_ABORT", "Callback routine requested an abort" }, ;
{ SQLITE_BUSY, "SQLITE_BUSY", "The database file is locked" }, ;
{ SQLITE_LOCKED, "SQLITE_LOCKED", "A table in the database is locked" }, ;
{ SQLITE_NOMEM, "SQLITE_NOMEM", "A malloc() failed" }, ;
{ SQLITE_READONLY, "SQLITE_READONLY", "Attempt to write a readonly database" }, ;
{ SQLITE_INTERRUPT, "SQLITE_INTERRUPT", "Operation terminated by sqlite3_interrupt()" }, ;
{ SQLITE_IOERR, "SQLITE_IOERR", "Some kind of disk I/O error occurred" }, ;
{ SQLITE_CORRUPT, "SQLITE_CORRUPT", "The database disk image is malformed" }, ;
{ SQLITE_NOTFOUND, "SQLITE_NOTFOUND", "NOT USED. Table or record not found" }, ;
{ SQLITE_FULL, "SQLITE_FULL", "Insertion failed because database is full" }, ;
{ SQLITE_CANTOPEN, "SQLITE_CANTOPEN", "Unable to open the database file" }, ;
{ SQLITE_PROTOCOL, "SQLITE_PROTOCOL", "NOT USED. Database lock protocol error" }, ;
{ SQLITE_EMPTY, "SQLITE_EMPTY", "Database is empty" }, ;
{ SQLITE_SCHEMA, "SQLITE_SCHEMA", "The database schema changed" }, ;
{ SQLITE_TOOBIG, "SQLITE_TOOBIG", "String or BLOB exceeds size limit" }, ;
{ SQLITE_CONSTRAINT, "SQLITE_CONSTRAINT", "Abort due to constraint violation" }, ;
{ SQLITE_MISMATCH, "SQLITE_MISMATCH", "Data type mismatch" }, ;
{ SQLITE_MISUSE, "SQLITE_MISUSE", "Library used incorrectly" }, ;
{ SQLITE_NOLFS, "SQLITE_NOLFS", "Uses OS features not supported on host" }, ;
{ SQLITE_AUTH, "SQLITE_AUTH", "Authorization denied" }, ;
{ SQLITE_FORMAT, "SQLITE_FORMAT", "Auxiliary database format error" }, ;
{ SQLITE_RANGE, "SQLITE_RANGE", "2nd parameter to sqlite3_bind out of range" }, ;
{ SQLITE_NOTADB, "SQLITE_NOTADB", "File opened that is not a database file" }, ;
{ SQLITE_ROW, "SQLITE_ROW", "sqlite3_step() has another row ready" }, ;
{ SQLITE_DONE, "SQLITE_DONE", "sqlite3_step() has finished executing" } ;
}, nIndex, cErrorMsg := "UNKNOWN"
hb_default( @lShortMsg, .T. )
@@ -200,7 +200,7 @@ STATIC FUNCTION cErrorMsg( nError, lShortMsg )
IF nError == 0
cErrorMsg := "SQLITE_OK"
ELSE
nIndex := AScan( aErrorCodes, {| x | x[ 1 ] == nError } )
nIndex := AScan( aErrorCodes, {| x | x[ 1 ] == nError } )
cErrorMsg := iif( nIndex > 0, aErrorCodes[ nIndex ][ iif( lShortMsg, 2, 3 ) ], cErrorMsg )
ENDIF
ENDIF
@@ -215,11 +215,11 @@ STATIC FUNCTION PrepareDB( cFile )
LOCAL cSQLTEXT, cMsg
LOCAL pDb, pStmt
LOCAL hPerson := { ;
"Bob" => 52, ;
"Fred" => 32, ;
"Bob" => 52, ;
"Fred" => 32, ;
"Sasha" => 17, ;
"Andy" => 20, ;
"Ivet" => 28 ;
"Andy" => 20, ;
"Ivet" => 28 ;
}, enum
pDb := sqlite3_open( cFile, .T. )
@@ -238,7 +238,7 @@ STATIC FUNCTION PrepareDB( cFile )
RETURN NIL
ENDIF
//
cSQLTEXT := "INSERT INTO person( name, age ) VALUES( :name, :age )"
pStmt := sqlite3_prepare( pDb, cSQLTEXT )
IF Empty( pStmt )
@@ -254,7 +254,7 @@ STATIC FUNCTION PrepareDB( cFile )
FOR EACH enum IN hPerson
sqlite3_reset( pStmt )
sqlite3_bind_text( pStmt, 1, enum:__enumKey() )
sqlite3_bind_int( pStmt, 2, enum:__enumValue() )
sqlite3_bind_int( pStmt, 2, enum:__enumValue() )
sqlite3_step( pStmt )
NEXT

View File

@@ -56,7 +56,8 @@
//#define SQLITE_ENABLE_COLUMN_METADATA
PROCEDURE main()
PROCEDURE Main()
LOCAL lCreateIfNotExist := .F.
LOCAL db := sqlite3_open( "new.s3db", lCreateIfNotExist )
@@ -69,6 +70,7 @@ PROCEDURE main()
/*
*/
PROCEDURE test( db )
IF sqlite3_exec( db, "SELECT * FROM t1" ) == SQLITE_OK
@@ -76,18 +78,18 @@ PROCEDURE test( db )
#ifdef SQLITE_ENABLE_COLUMN_METADATA
? "Column name : id"
? "Declared data type: ", sqlite3_table_column_metadata( db, , "t1", "id" )[ 1 ]
? "Collation sequence name: ", sqlite3_table_column_metadata( db, , "t1", "id" )[ 2 ]
? "NOT NULL constraint exists: ", sqlite3_table_column_metadata( db, , "t1", "id" )[ 3 ]
? "Column is part of PK: ", sqlite3_table_column_metadata( db, , "t1", "id" )[ 4 ]
? "Column is auto-increment: ", sqlite3_table_column_metadata( db, , "t1", "id" )[ 5 ]
? "Declared data type: ", sqlite3_table_column_metadata( db,, "t1", "id" )[ 1 ]
? "Collation sequence name: ", sqlite3_table_column_metadata( db,, "t1", "id" )[ 2 ]
? "NOT NULL constraint exists: ", sqlite3_table_column_metadata( db,, "t1", "id" )[ 3 ]
? "Column is part of PK: ", sqlite3_table_column_metadata( db,, "t1", "id" )[ 4 ]
? "Column is auto-increment: ", sqlite3_table_column_metadata( db,, "t1", "id" )[ 5 ]
? "Column name : name"
? "Declared data type: ", sqlite3_table_column_metadata( db, , "t1", "name" )[ 1 ]
? "Collation sequence name: ", sqlite3_table_column_metadata( db, , "t1", "name" )[ 2 ]
? "NOT NULL constraint exists: ", sqlite3_table_column_metadata( db, , "t1", "name" )[ 3 ]
? "Column is part of PK: ", sqlite3_table_column_metadata( db, , "t1", "name" )[ 4 ]
? "Column is auto-increment: ", sqlite3_table_column_metadata( db, , "t1", "name" )[ 5 ]
? "Declared data type: ", sqlite3_table_column_metadata( db,, "t1", "name" )[ 1 ]
? "Collation sequence name: ", sqlite3_table_column_metadata( db,, "t1", "name" )[ 2 ]
? "NOT NULL constraint exists: ", sqlite3_table_column_metadata( db,, "t1", "name" )[ 3 ]
? "Column is part of PK: ", sqlite3_table_column_metadata( db,, "t1", "name" )[ 4 ]
? "Column is auto-increment: ", sqlite3_table_column_metadata( db,, "t1", "name" )[ 5 ]
#endif
sqlite3_sleep( 3000 )

View File

@@ -54,7 +54,8 @@
#include "hbsqlit3.ch"
PROCEDURE main()
PROCEDURE Main()
LOCAL db := sqlite3_open_v2( "new.s3db", SQLITE_OPEN_READWRITE + SQLITE_OPEN_EXCLUSIVE )
IF ! Empty( db )

View File

@@ -57,7 +57,7 @@
#define TRACE
#define TABLE_SQL "CREATE TABLE t1( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER )"
PROCEDURE main()
PROCEDURE Main()
? sqlite3_libversion()
sqlite3_sleep( 3000 )
@@ -148,7 +148,7 @@ PROCEDURE t2()
? "The number of database rows that were changed: " + hb_ntos( sqlite3_changes( db ) )
? "Total changes: " + hb_ntos( sqlite3_total_changes( db ) )
? "Last _ROWID_: " + str( sqlite3_last_insert_rowid( db ) )
? "Last _ROWID_: " + Str( sqlite3_last_insert_rowid( db ) )
? ""
stmt := sqlite3_prepare( db, "SELECT * FROM t1 WHERE name == :name ")
@@ -161,7 +161,7 @@ PROCEDURE t2()
DO WHILE sqlite3_step( stmt ) == SQLITE_ROW
nCCount := sqlite3_column_count( stmt )
++nJ
? "Record # " + str( nJ )
? "Record # " + Str( nJ )
IF nCCount > 0
FOR nI := 0 TO nCCount - 1
@@ -176,7 +176,7 @@ PROCEDURE t2()
EXIT
CASE SQLITE_INTEGER
?? str ( sqlite3_column_int( stmt, nI ) )
?? Str( sqlite3_column_int( stmt, nI ) )
EXIT
CASE SQLITE_NULL
@@ -191,7 +191,7 @@ PROCEDURE t2()
NEXT
ENDIF
ENDDO
? "Total records - " + str( nJ )
? "Total records - " + Str( nJ )
sqlite3_clear_bindings( stmt )
sqlite3_finalize( stmt )
@@ -207,7 +207,7 @@ PROCEDURE t2()
DO WHILE sqlite3_step( stmt ) == SQLITE_ROW
nCCount := sqlite3_column_count( stmt )
++nJ
? "Record # " + str( nJ )
? "Record # " + Str( nJ )
IF nCCount > 0
FOR nI := 1 TO nCCount
@@ -222,7 +222,7 @@ PROCEDURE t2()
EXIT
CASE SQLITE_INTEGER
?? str( sqlite3_column_int( stmt, nI ) )
?? Str( sqlite3_column_int( stmt, nI ) )
EXIT
CASE SQLITE_NULL
@@ -237,7 +237,7 @@ PROCEDURE t2()
NEXT
ENDIF
ENDDO
? "Total records - " + str( nJ )
? "Total records - " + Str( nJ )
sqlite3_clear_bindings( stmt )
sqlite3_finalize( stmt )

View File

@@ -195,7 +195,7 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ;
IF cPopServer != NIL .AND. lPopAuth
BEGIN SEQUENCE
oUrl1 := tUrl():New( iif( lTLS, "pop3s://" , "pop://" ) + cUser + ":" + cPass + "@" + cPopServer + "/" )
oUrl1 := tUrl():New( iif( lTLS, "pop3s://", "pop://" ) + cUser + ":" + cPass + "@" + cPopServer + "/" )
oUrl1:cUserid := StrTran( cUser, "&at;", "@" )
oPop := tIPClientPOP():New( oUrl1, xTrace )
IF oPop:Open()

View File

@@ -28,7 +28,7 @@ PROCEDURE Main( ... )
LOCAL cData
LOCAL cBuffer := Space( 1024 )
LOCAL nLen
LOCAL lHelp := .F. , lDecode := .F. , lQp := .F. , lUrl := .F.
LOCAL lHelp := .F., lDecode := .F., lQp := .F., lUrl := .F.
LOCAL hInput := hSTDIN
LOCAL hOutput := hSTDOUT

View File

@@ -40,7 +40,7 @@ PROCEDURE Main( cUrl )
? hb_HKeyAt( oCon:hHeaders, i ) + ":", hb_HValueAt( oCon:hHeaders, i )
NEXT
ELSE
? "Get failure (server reply:", oCon:cReply , ")"
? "Get failure (server reply:", oCon:cReply, ")"
ENDIF
oCon:Close()

View File

@@ -1712,7 +1712,7 @@ FUNCTION THtmlTagType( cTagName )
FUNCTION THtmlIsValid( cTagName, cAttrName )
LOCAL lRet := .T. , aValue
LOCAL lRet := .T., aValue
IF t_hTagTypes == NIL
THtmlInit()

View File

@@ -465,7 +465,7 @@ FUNCTION tp_waitfor( ... )
IF lIgnorecase
nAt := At( Upper( acList[ x ] ), Upper( t_aPorts[ nPort, TPFP_INBUF ] ) )
ELSE
nAt := At( acList[ x ] , t_aPorts[ nPort, TPFP_INBUF ] )
nAt := At( acList[ x ], t_aPorts[ nPort, TPFP_INBUF ] )
ENDIF
IF nAt > 0 .AND. nAt < nFirst
nFirst := nAt

View File

@@ -337,7 +337,7 @@ STATIC PROCEDURE Exm_OOWriter()
oTable:getCellByName( "C2" ):setValue( 106.38 )
oTable:getCellByName( "D2" ):setFormula( "sum <A2:C2>" )
oText:insertControlCharacter( oCursor, 0 , .F. ) // PARAGRAPH_BREAK
oText:insertControlCharacter( oCursor, 0, .F. ) // PARAGRAPH_BREAK
oCursor:setPropertyValue( "CharColor", 255 )
oText:insertString( oCursor, "Good bye!", .F. )

View File

@@ -142,7 +142,7 @@ PROCEDURE Main()
// AdsUseDictionary( .T. ) this function no longer is needed; the system knows if it's using a Data Dictionary connection
// Open the "long table name" for Table2
dbUseArea( .T. , , "Customer Data", "custom", .T. , .F. )
dbUseArea( .T., , "Customer Data", "custom", .T. , .F. )
? "Press a key to browse", Alias()
Inkey( 0 )
Browse()

View File

@@ -91,14 +91,14 @@ PROCEDURE Main()
aRay := AdsMgGetInstallInfo()
IF Len( aRay ) > 7
? "Install info:"
? aRay[1]
? aRay[2]
? aRay[3]
? aRay[4]
? aRay[5]
? aRay[6]
? aRay[7]
? aRay[8]
? aRay[ 1 ]
? aRay[ 2 ]
? aRay[ 3 ]
? aRay[ 4 ]
? aRay[ 5 ]
? aRay[ 6 ]
? aRay[ 7 ]
? aRay[ 8 ]
?
ENDIF
@@ -108,59 +108,59 @@ PROCEDURE Main()
aRay := AdsMgGetActivityInfo( 3 )
IF Len( aRay ) > 3
? "Up Time:", aRay[1], aRay[2], aRay[3], aRay[4]
? "Up Time:", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ], aRay[ 4 ]
?
ENDIF
? " Item In Use MaxUsed Rejected"
aRay := AdsMgGetActivityInfo( 4 )
IF Len( aRay ) > 2
? "Users: ", aRay[1], aRay[2], aRay[3]
? "Users: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 5 )
IF Len( aRay ) > 2
? "Connections: ", aRay[1], aRay[2], aRay[3]
? "Connections: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 6 )
IF Len( aRay ) > 2
? "WorkAreas: ", aRay[1], aRay[2], aRay[3]
? "WorkAreas: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 7 )
IF Len( aRay ) > 2
? "Tables: ", aRay[1], aRay[2], aRay[3]
? "Tables: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 8 )
IF Len( aRay ) > 2
? "Indexes: ", aRay[1], aRay[2], aRay[3]
? "Indexes: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 9 )
IF Len( aRay ) > 2
? "Locks: ", aRay[1], aRay[2], aRay[3]
? "Locks: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 10 )
IF Len( aRay ) > 2
? "TpsHeaderElems:", aRay[1], aRay[2], aRay[3]
? "TpsHeaderElems:", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 11 )
IF Len( aRay ) > 2
? "TpsVisElems: ", aRay[1], aRay[2], aRay[3]
? "TpsVisElems: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 12 )
IF Len( aRay ) > 2
? "TpsMemoElems: ", aRay[1], aRay[2], aRay[3]
? "TpsMemoElems: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
aRay := AdsMgGetActivityInfo( 13 )
IF Len( aRay ) > 2
? "WorkerThreads: ", aRay[1], aRay[2], aRay[3]
? "WorkerThreads: ", aRay[ 1 ], aRay[ 2 ], aRay[ 3 ]
ENDIF
WAIT
@@ -168,17 +168,17 @@ PROCEDURE Main()
aRay := AdsMgGetCommStats()
IF Len( aRay ) > 10
? aRay[1] , "% of pkts with checksum failures "
? aRay[2] , "Total packets received "
? aRay[3] , "Receive packets out of sequence "
? aRay[4] , "Packet owner not logged in "
? aRay[5] , "Receive requests out of sequence "
? aRay[6] , "Checksum failures "
? aRay[7] , "Server initiated disconnects "
? aRay[8] , "Removed partial connections "
? aRay[9] , "Rcvd invalid packets (NT only) "
? aRay[10], "RecvFrom failed (NT only) "
? aRay[11], "SendTo failed (NT only) "
? aRay[ 1 ], "% of pkts with checksum failures "
? aRay[ 2 ], "Total packets received "
? aRay[ 3 ], "Receive packets out of sequence "
? aRay[ 4 ], "Packet owner not logged in "
? aRay[ 5 ], "Receive requests out of sequence "
? aRay[ 6 ], "Checksum failures "
? aRay[ 7 ], "Server initiated disconnects "
? aRay[ 8 ], "Removed partial connections "
? aRay[ 9 ], "Rcvd invalid packets (NT only) "
? aRay[ 10 ], "RecvFrom failed (NT only) "
? aRay[ 11 ], "SendTo failed (NT only) "
ENDIF
WAIT
@@ -186,32 +186,32 @@ PROCEDURE Main()
aRay := AdsMgGetConfigInfo( 0 )
IF Len( aRay ) > 24
? aRay[1] , " number connections "
? aRay[2] , " number work areas "
? aRay[3] , " number tables "
? aRay[4] , " number indexes "
? aRay[5] , " number locks "
? aRay[6] , " user buffer "
? aRay[7] , " statistics dump interval "
? aRay[8] , " max size of error log "
? aRay[9] , " number TPS header elems "
? aRay[10], " number TPS vis elems "
? aRay[11], " number TPS memo elems "
? aRay[12], " number rcv ECBs (NLM only) "
? aRay[13], " number send ECBs (NLM only) "
? aRay[14], " number packets per burst "
? aRay[15], " number worker threads "
? aRay[16], " index sort buffer size "
? aRay[17], " reserved "
? aRay[18], " reserved "
? aRay[19], " error log path "
? aRay[20], " semaphore file path "
? aRay[21], " TPS log file path "
? aRay[22], " reserved "
? aRay[23], " reserved "
? aRay[24], " NT Service IP send port # "
? aRay[25], " NT Service IP rcv port # "
// ? aRay[26], " reserved "
? aRay[ 1 ], " number connections "
? aRay[ 2 ], " number work areas "
? aRay[ 3 ], " number tables "
? aRay[ 4 ], " number indexes "
? aRay[ 5 ], " number locks "
? aRay[ 6 ], " user buffer "
? aRay[ 7 ], " statistics dump interval "
? aRay[ 8 ], " max size of error log "
? aRay[ 9 ], " number TPS header elems "
? aRay[ 10 ], " number TPS vis elems "
? aRay[ 11 ], " number TPS memo elems "
? aRay[ 12 ], " number rcv ECBs (NLM only) "
? aRay[ 13 ], " number send ECBs (NLM only) "
? aRay[ 14 ], " number packets per burst "
? aRay[ 15 ], " number worker threads "
? aRay[ 16 ], " index sort buffer size "
? aRay[ 17 ], " reserved "
? aRay[ 18 ], " reserved "
? aRay[ 19 ], " error log path "
? aRay[ 20 ], " semaphore file path "
? aRay[ 21 ], " TPS log file path "
? aRay[ 22 ], " reserved "
? aRay[ 23 ], " reserved "
? aRay[ 24 ], " NT Service IP send port # "
? aRay[ 25 ], " NT Service IP rcv port # "
// ? aRay[ 26 ], " reserved "
ENDIF
WAIT
@@ -219,19 +219,19 @@ PROCEDURE Main()
aRay := AdsMgGetConfigInfo( 1 )
IF Len( aRay ) > 12
? aRay[1] , " Total mem taken by cfg params "
? aRay[2] , " memory taken by connections "
? aRay[3] , " memory taken by work areas "
? aRay[4] , " memory taken by tables "
? aRay[5] , " memory taken by indexes "
? aRay[6] , " memory taken by locks "
? aRay[7] , " memory taken by user buffer "
? aRay[8] , " memory taken by TPS hdr elems "
? aRay[9] , " memory taken by TPS vis elems "
? aRay[10], " mem taken by TPS memo elems "
? aRay[11], " mem taken by rcv ECBs (NLM) "
? aRay[12], " mem taken by send ECBs (NLM) "
? aRay[13], " mem taken by worker threads "
? aRay[ 1 ], " Total mem taken by cfg params "
? aRay[ 2 ], " memory taken by connections "
? aRay[ 3 ], " memory taken by work areas "
? aRay[ 4 ], " memory taken by tables "
? aRay[ 5 ], " memory taken by indexes "
? aRay[ 6 ], " memory taken by locks "
? aRay[ 7 ], " memory taken by user buffer "
? aRay[ 8 ], " memory taken by TPS hdr elems "
? aRay[ 9 ], " memory taken by TPS vis elems "
? aRay[ 10 ], " mem taken by TPS memo elems "
? aRay[ 11 ], " mem taken by rcv ECBs (NLM) "
? aRay[ 12 ], " mem taken by send ECBs (NLM) "
? aRay[ 13 ], " mem taken by worker threads "
ENDIF
?

View File

@@ -9,7 +9,7 @@ REQUEST SQLMIX
PROCEDURE Main()
rddSetDefault( "SQLMIX" )
dbCreate( "persons", { { "NAME", "C", 20, 0 }, { "FAMILYNAME", "C", 20, 0 }, { "BIRTH", "D", 8, 0 }, { "AMOUNT", "N", 9, 2 } }, , .T. , "persons" )
dbCreate( "persons", { { "NAME", "C", 20, 0 }, { "FAMILYNAME", "C", 20, 0 }, { "BIRTH", "D", 8, 0 }, { "AMOUNT", "N", 9, 2 } }, , .T., "persons" )
dbAppend(); AEval( { PadR( "Bil", 20 ), PadR( "Gatwick", 20 ), SToD( "19650124" ), 123456.78 }, {| X, Y | FieldPut( Y, X ) } )
dbAppend(); AEval( { PadR( "Tom", 20 ), PadR( "Heathrow", 20 ), SToD( "19870512" ), 9086.54 }, {| X, Y | FieldPut( Y, X ) } )

View File

@@ -28,7 +28,7 @@ PROCEDURE Main()
? "Let's browse table (press any key)"
Inkey( 0 )
dbUseArea( .T. , , "SELECT * FROM country", "country" )
dbUseArea( .T., , "SELECT * FROM country", "country" )
Browse()
? "Let's browse table ordered by resident count (press any key)"

View File

@@ -22,7 +22,7 @@ PROCEDURE Main()
? "Unable connect to the server"
ENDIF
? "-2-"
? "Use:", dbUseArea( .T. , , "select * from emp", "emp" )
? "Use:", dbUseArea( .T., , "select * from emp", "emp" )
? "-3-"
? "Alias:", Alias()
? "-4-"

View File

@@ -12,7 +12,7 @@ PROCEDURE Main()
rddSetDefault( "SQLMIX" )
Set( _SET_DATEFORMAT, "yyyy-mm-dd" )
? "Connect:", rddInfo( RDDI_CONNECT, { "ODBC", "DBQ=" + hb_DirBase() + "..\..\hbodbc\tests\test.mdb;Driver={Microsoft Access Driver (*.mdb)}" } )
? "Use:", dbUseArea( .T. , , "select * from test", "test" )
? "Use:", dbUseArea( .T., , "select * from test", "test" )
? "Alias:", Alias()
? "DB struct:", hb_ValToExp( dbStruct() )
Inkey( 0 )

View File

@@ -22,7 +22,7 @@ PROCEDURE Main()
? rddInfo( RDDI_EXECUTE, "DROP TABLE country" )
? rddInfo( RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME char(50), RESIDENTS int(11))" )
? rddInfo( RDDI_EXECUTE, "INSERT INTO country values ('LTU', 'Lithuania', 3369600),('USA', 'United States of America', 305397000), ('POR', 'Portugal', 10617600), ('POL', 'Poland', 38115967), ('AUS', 'Australia', 21446187), ('FRA', 'France', 64473140), ('RUS', 'Russia', 141900000)" )
? dbUseArea( .T. , , "SELECT * FROM country", "country" )
? dbUseArea( .T., , "SELECT * FROM country", "country" )
? "LASTREC:", LastRec()
DO WHILE ! EOF()
aI := Array( FCount() )

View File

@@ -24,7 +24,7 @@ PROCEDURE Main()
? "Unable connect to the server"
ENDIF
? "-2-"
? "Use:", dbUseArea( .T. , , "select * from t1", "t1" )
? "Use:", dbUseArea( .T., , "select * from t1", "t1" )
? "-3-"
? "Alias:", Alias()
? "-4-"

View File

@@ -180,7 +180,7 @@ STATIC FUNCTION DShowProperties( oVar, nScope, lRecursive, nIndent, nRecursionLe
IF HB_ISOBJECT( oVar )
// lOldScope := __SetClassScope( .F. )
aMethods := __objGetMsgFullList( oVar, .F. , HB_MSGLISTALL, nScope )
aMethods := __objGetMsgFullList( oVar, .F., HB_MSGLISTALL, nScope )
aProps := __objGetValueFullList( oVar, NIL, nScope )
// __SetClassScope( lOldScope )
@@ -427,7 +427,7 @@ STATIC FUNCTION __objGetValueFullList( oObject, aExcept, nScope, nNoScope )
aExcept := {}
ENDIF
aVars := __objGetMsgFullList( oObject, .T. , HB_MSGLISTALL, nScope, nNoScope )
aVars := __objGetMsgFullList( oObject, .T., HB_MSGLISTALL, nScope, nNoScope )
aReturn := {}
FOR EACH aVar IN aVars
IF hb_AScan( aExcept, aVar[HB_OO_DATA_SYMBOL], , , .T. ) == 0

View File

@@ -207,7 +207,7 @@ FUNCTION HB_LogDateStamp()
LOCAL dToday := Date()
RETURN Str( Year( dToday ), 4 ) + "-" + PadL( Month( dToday ) , 2, "0" ) + "-" + PadL( Day( dToday ), 2, "0" )
RETURN Str( Year( dToday ), 4 ) + "-" + PadL( Month( dToday ), 2, "0" ) + "-" + PadL( Day( dToday ), 2, "0" )
/**********************************************
* Logger class
@@ -606,12 +606,11 @@ CLASS HB_LogDbf FROM HB_LogChannel
VAR cIndexName INIT "messages.cdx"
VAR cDriver INIT "DBFCDX"
VAR aStruct INIT { ;
{ "PRIORITY", "N", 2, 0 } , ;
{ "PROGNAME", "C", 30, 0 } , ;
{ "MESSAGE" , "C", 250, 0 } , ;
{ "DATE" , "D", 8, 0 } , ;
{ "TIME" , "C", 8, 0 } ;
}
{ "PRIORITY", "N", 2, 0 }, ;
{ "PROGNAME", "C", 30, 0 }, ;
{ "MESSAGE" , "C", 250, 0 }, ;
{ "DATE" , "D", 8, 0 }, ;
{ "TIME" , "C", 8, 0 } }
METHOD New( nLevel, cDBFName, cIndexName, aStruct, cDriver )
METHOD Open( cProgName )
@@ -633,7 +632,7 @@ METHOD New( nLevel, cDBFName, cIndexName, aStruct, cDriver ) CLASS HB_LogDbf
cExt := "dbf"
ENDIF
::cDBFName := iif( !Empty( cDrive ), cDrive + ":\", "" ) + ;
iif( !Empty( cPath ) , cPath + "\", "" ) + ;
iif( !Empty( cPath ), cPath + "\", "" ) + ;
cName + cExt
//__OutDebug( "::cDBFName", ::cDBFName )
ENDIF
@@ -644,7 +643,7 @@ METHOD New( nLevel, cDBFName, cIndexName, aStruct, cDriver ) CLASS HB_LogDbf
cExt := "cdx"
ENDIF
::cIndexName := iif( !Empty( cDrive ), cDrive + ":\", "" ) + ;
iif( !Empty( cPath ) , cPath + "\", "" ) + ;
iif( !Empty( cPath ), cPath + "\", "" ) + ;
cName + cExt
//__OutDebug( "::cCDXName", ::cCDXName )
ENDIF
@@ -667,18 +666,18 @@ METHOD Open( cProgName ) CLASS HB_LogDbf
IF ! hb_FileExists( ::cDBFName )
dbCreate( ::cDBFName, ::aStruct )
dbUseArea( .T. , ::cDriver, ::cDBFName, "LogDbf", .T. )
dbUseArea( .T., ::cDriver, ::cDBFName, "LogDbf", .T. )
INDEX ON DToS( FIELD->date ) + FIELD->time + Str( FIELD->priority, 2 ) + FIELD->MESSAGE TAG "datetime" TO ( ::cIndexName )
INDEX ON Str( FIELD->priority, 2 ) + DToS( FIELD->date ) + FIELD->time + FIELD->MESSAGE TAG "priority" TO ( ::cIndexName )
LogDbf->( dbCloseArea() )
ELSEIF ! hb_FileExists( ::cIndexName )
dbUseArea( .T. , ::cDriver, ::cDBFName, "LogDbf", .T. )
dbUseArea( .T., ::cDriver, ::cDBFName, "LogDbf", .T. )
INDEX ON DToS( FIELD->date ) + FIELD->time + Str( FIELD->priority, 2 ) + FIELD->MESSAGE TAG "datetime" TO ( ::cIndexName )
INDEX ON Str( FIELD->priority, 2 ) + DToS( FIELD->date ) + FIELD->time + FIELD->MESSAGE TAG "priority" TO ( ::cIndexName )
LogDbf->( dbCloseArea() )
ENDIF
// __OutDebug( "::cDriver, ::cDBFName", ::cDriver, ::cDBFName )
dbUseArea( .T. , ::cDriver, ::cDBFName, "LogDbf", .T. )
dbUseArea( .T., ::cDriver, ::cDBFName, "LogDbf", .T. )
SET INDEX TO ( ::cIndexName )
LogDbf->( dbAppend() )

View File

@@ -557,7 +557,7 @@ METHOD RUN() CLASS tRPCServeCon
/* Execute function */
CASE cCode == "XHBR20"
IF nSafeStatus == RPCS_STATUS_LOGGED
aData := ::RecvFunction( .F. , .F. )
aData := ::RecvFunction( .F., .F. )
IF aData != NIL
lBreak := ! ::FuncCall( aData[ 2 ] )
ELSE
@@ -573,7 +573,7 @@ METHOD RUN() CLASS tRPCServeCon
/* Execute function */
CASE cCode == "XHBR21"
IF nSafeStatus == RPCS_STATUS_LOGGED
aData := ::RecvFunction( .T. , .F. )
aData := ::RecvFunction( .T., .F. )
IF aData != NIL
lBreak := ! ::FuncCall( aData[ 2 ] )
ELSE
@@ -588,7 +588,7 @@ METHOD RUN() CLASS tRPCServeCon
/* Loop function */
CASE cCode == "XHBR22"
IF nSafeStatus == RPCS_STATUS_LOGGED
aData := ::RecvFunction( .F. , .T. )
aData := ::RecvFunction( .F., .T. )
IF aData != NIL
lBreak := ! ::FuncLoopCall( aData[ 1 ], aData[ 2 ] )
ELSE
@@ -603,7 +603,7 @@ METHOD RUN() CLASS tRPCServeCon
/* Loop function - compressed */
CASE cCode == "XHBR23"
IF nSafeStatus == RPCS_STATUS_LOGGED
aData := ::RecvFunction( .T. , .T. )
aData := ::RecvFunction( .T., .T. )
IF aData != NIL
lBreak := ! ::FuncLoopCall( aData[ 1 ], aData[ 2 ] )
ELSE
@@ -618,7 +618,7 @@ METHOD RUN() CLASS tRPCServeCon
/* Foreach function */
CASE cCode == "XHBR24"
IF nSafeStatus == RPCS_STATUS_LOGGED
aData := ::RecvFunction( .F. , .T. )
aData := ::RecvFunction( .F., .T. )
IF aData != NIL
lBreak := ! ::FuncForeachCall( aData[ 1 ], aData[ 2 ] )
ELSE
@@ -633,7 +633,7 @@ METHOD RUN() CLASS tRPCServeCon
/* Foreach function - compressed*/
CASE cCode == "XHBR25"
IF nSafeStatus == RPCS_STATUS_LOGGED
aData := ::RecvFunction( .T. , .T. )
aData := ::RecvFunction( .T., .T. )
IF aData != NIL
lBreak := ! ::FuncForeachCall( aData[ 1 ], aData[ 2 ] )
ELSE
@@ -1288,7 +1288,7 @@ METHOD Add( xFunction, cVersion, nLevel, oExec, oMethod )
hb_mutexLock( ::mtxBusy )
nElem := AScan( ::aFunctions, {| x | oFunction:cName == x:cName } )
IF nElem == 0
AAdd( ::aFunctions , oFunction )
AAdd( ::aFunctions, oFunction )
lRet := .T.
ENDIF
hb_mutexUnlock( ::mtxBusy )

View File

@@ -116,11 +116,11 @@ CLASS tRPCClient
METHOD HasError() INLINE ::nErrorCode != 0 .OR. ::TcpHasError() .OR. ::UdpHasError()
METHOD GetErrorCode() INLINE ::nErrorCode
METHOD TcpHasError() INLINE iif( Empty( ::skTCP ), .F. , hb_inetErrorCode( ::skTCP ) > 0 )
METHOD TcpHasError() INLINE iif( Empty( ::skTCP ), .F., hb_inetErrorCode( ::skTCP ) > 0 )
METHOD GetTcpErrorCode() INLINE iif( Empty( ::skTCP ), 0, hb_inetErrorCode( ::skTCP ) )
METHOD GetTcpErrorDesc() INLINE iif( Empty( ::skTCP ), "", hb_inetErrorDesc( ::skTCP ) )
METHOD UdpHasError() INLINE iif( Empty( ::skUDP ), .F. , hb_inetErrorCode( ::skUDP ) > 0 )
METHOD UdpHasError() INLINE iif( Empty( ::skUDP ), .F., hb_inetErrorCode( ::skUDP ) > 0 )
METHOD UdpGetErrorCode() INLINE iif( Empty( ::skUDP ), 0, hb_inetErrorCode( ::skUDP ) )
METHOD UdpGetErrorDesc() INLINE iif( Empty( ::skUDP ), "", hb_inetErrorDesc( ::skUDP ) )
/* Used to retreive data from scans */
@@ -257,7 +257,7 @@ METHOD ScanServers( cName ) CLASS tRPCClient
::aServers := {}
hb_mutexUnlock( ::mtxBusy )
hb_inetDGramSend( ::skUDP, ::cNetwork , ::nUdpPort, "XHBR00" + hb_Serialize( cName ) )
hb_inetDGramSend( ::skUDP, ::cNetwork, ::nUdpPort, "XHBR00" + hb_Serialize( cName ) )
::StartScan()
RETURN .F.

View File

@@ -513,7 +513,7 @@ CLASS HBField
DATA Value
METHOD Get() INLINE ::value := ( ::alias )->( FieldGet( ::order ) )
METHOD Put( x ) INLINE ::value := x , ;
METHOD Put( x ) INLINE ::value := x, ;
( ::alias )->( FieldPut( ::order, x ) )
ENDCLASS
@@ -667,7 +667,7 @@ CLASS HBTable
METHOD CONTINUE() INLINE ( ::Alias )->( __dbContinue() )
METHOD Found() INLINE ( ::Alias )->( Found() )
METHOD Kill() INLINE ( ::Alias )->( dbCommit() ), ;
( ::Alias )->( dbUnlock() ) , ;
( ::Alias )->( dbUnlock() ), ;
( ::Alias )->( dbCloseArea() ), ;
::ClearBuffers()
METHOD ClearBuffers() INLINE ::ReadBuffers := {}, ;
@@ -725,7 +725,7 @@ CLASS HBTable
( ::alias )->( ordScope( TOPSCOPE, xScope ) )
METHOD SetBottomScope( xScope ) INLINE ;
( ::alias )->( ordScope( BOTTOMSCOPE, xScope ) )
METHOD KillScope() INLINE ( ::alias )->( ordScope( TOPSCOPE, NIL ) ) , ;
METHOD KillScope() INLINE ( ::alias )->( ordScope( TOPSCOPE, NIL ) ), ;
( ::alias )->( ordScope( BOTTOMSCOPE, NIL ) )
METHOD New( cDBF, cALIAS, cOrderBag, cDRIVER, ;
@@ -1083,7 +1083,7 @@ METHOD __oTDelete( lKeepBuffer ) // ::Delete()
::Read()
IF ::isNet
lRet := iif( ( ::Alias )->( NetDelete() ), .T. , .F. )
lRet := iif( ( ::Alias )->( NetDelete() ), .T., .F. )
ELSE
( ::alias )->( dbDelete() ) ; lRet := .T.
ENDIF
@@ -1540,7 +1540,7 @@ METHOD PROCEDURE CREATE() CLASS HBOrder
// ? "<<<", ::alias, ::cOrderBag
( ::alias )->( ordCondSet( ::cFor, ::bFor, ;
.T. , ;
.T., ;
::bWhile, ;
::bEval, ::nInterval ) )

View File

@@ -85,7 +85,7 @@ FUNCTION CStrToVal( cExp, cType )
ENDIF
CASE "L"
RETURN iif( cExp[ 1 ] == "T" .OR. cExp[ 1 ] == "Y" .OR. cExp[ 2 ] == "T" .OR. cExp[ 2 ] == "Y", .T. , .F. )
RETURN iif( cExp[ 1 ] == "T" .OR. cExp[ 1 ] == "Y" .OR. cExp[ 2 ] == "T" .OR. cExp[ 2 ] == "Y", .T., .F. )
CASE "N"
RETURN Val( cExp )
@@ -114,7 +114,7 @@ FUNCTION CStrToVal( cExp, cType )
FUNCTION StringToLiteral( cString )
LOCAL lDouble := .F. , lSingle := .F.
LOCAL lDouble := .F., lSingle := .F.
IF hb_regexHas( "\n|\r", cString ) .OR. ;
( ( lDouble := '"' $ cString ) .AND. ( lSingle := "'" $ cString ) .AND. hb_regexHas( "\[|\]", cString ) )

View File

@@ -340,7 +340,7 @@ STATIC FUNCTION LogError( oerr )
IF nHandle < 3
ELSE
FWriteLine( nHandle, PadC( " xHarbour Error Log " , 79, "-" ) )
FWriteLine( nHandle, PadC( " xHarbour Error Log ", 79, "-" ) )
FWriteLine( nHandle, "" )
FWriteLine( nHandle, "Date...............: " + DToC( Date() ) )

View File

@@ -275,7 +275,7 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS
// 2006/JUL/22 - E.F. To avoid run time error.
IF nTop > nBottom .OR. nLeft > nRight
Throw( ErrorNew( "BASE", 0, 1127, "Argument error: <nTop,nRight,nLeft,nBottom>" , ProcName() ) )
Throw( ErrorNew( "BASE", 0, 1127, "Argument error: <nTop,nRight,nLeft,nBottom>", ProcName() ) )
ENDIF
@@ -369,7 +369,7 @@ METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabS
// Setting datas that depend of ::aText filled.
//
::nRow := Max( 1, Min( ::nTextRow, Len( ::aText ) ) )
::nCol := Max( 1, Min( Len( ::aText[ ::nRow ]:cText ) , ::nTextCol + 1 ) )
::nCol := Max( 1, Min( Len( ::aText[ ::nRow ]:cText ), ::nTextCol + 1 ) )
// extra sanitization over max bounds
IF ::nFirstRow > ::LastRow()
@@ -543,7 +543,7 @@ METHOD RefreshLine( lRefreshColSel ) CLASS XHBEditor
// nCol := nFirstCol + ::nColSelStart - 1
nCol := Max( ::nLeft, nFirstCol + ::nColSelStart - 1 )
hb_DispOutAt( ::Row(), nCol, SubStr( ::GetLine( ::nRow ), Max(1,::nColSelStart ), (::nColSelEnd - ::nColSelStart + 1 ) ) , ::ColColor() )
hb_DispOutAt( ::Row(), nCol, SubStr( ::GetLine( ::nRow ), Max(1,::nColSelStart ), (::nColSelEnd - ::nColSelStart + 1 ) ), ::ColColor() )
ENDIF
@@ -785,7 +785,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor
::ClrTextSelection()
::lChanged := .T.
::Home()
::InsertLine( "", .F. , ::nRow )
::InsertLine( "", .F., ::nRow )
::RefreshLine()
::RefreshWindow()
ENDIF
@@ -1185,7 +1185,7 @@ METHOD Right() CLASS XHBEditor
ELSE
IF ::nCol < Max( ::nNumCols, ::nWordWrapCol + 1 )
//::GotoCol( ::nCol + 1 )
::GotoPos( ::nRow, ::nCol + 1 , .T. )
::GotoPos( ::nRow, ::nCol + 1, .T. )
ENDIF
ENDIF
@@ -1294,7 +1294,7 @@ METHOD Left() CLASS XHBEditor
IF ::nRow > 1
// 2006/07/19 E.F. left should be at max in the leftmost column.
//
::GotoPos( ::nRow - 1, Max( ::nNumCols, ::nWordWrapCol + 1 ) , .T. )
::GotoPos( ::nRow - 1, Max( ::nNumCols, ::nWordWrapCol + 1 ), .T. )
ENDIF
//else do nothing
ENDIF
@@ -1705,7 +1705,7 @@ METHOD K_Return() CLASS XHBEditor
::nCol > ::LineLen( ::nRow )
::AddLine( "", .F. )
ELSE
::InsertLine( SubStr( ::aText[ ::nRow ]:cText, ::nCol ), .F. , ::nRow + 1 )
::InsertLine( SubStr( ::aText[ ::nRow ]:cText, ::nCol ), .F., ::nRow + 1 )
ENDIF
::aText[ ::nRow ]:cText := Left( ::aText[ ::nRow ]:cText, ::nCol - 1 )
@@ -2188,7 +2188,7 @@ METHOD SplitLine( nRow ) CLASS XHBEditor
ENDIF
// We must not trim the line as split occurs next to a space
//
::InsertLine( cSplittedLine, .T. , nStartRow++ )
::InsertLine( cSplittedLine, .T., nStartRow++ )
cLine := SubStr( cLine, Len( cSplittedLine ) + 1 )
ENDDO
@@ -2200,10 +2200,10 @@ METHOD SplitLine( nRow ) CLASS XHBEditor
//
IF nStartRow + 1 <= ::LastRow()
IF ::LineLen( nStartRow + 1 ) == 0 .OR. Len( AllTrim( cLine ) ) > 0
::InsertLine( RTrim( cLine ), .F. , nStartRow )
::InsertLine( RTrim( cLine ), .F., nStartRow )
ENDIF
ELSE
::InsertLine( RTrim( cLine ), .F. , nStartRow )
::InsertLine( RTrim( cLine ), .F., nStartRow )
ENDIF
// re-count words and see where current word has gone.
@@ -2858,7 +2858,7 @@ METHOD GetTextIndex() CLASS XHBEditor
IF ::lWordWrap
FOR nCount := 1 TO ::nRow - 1
oItem := ::aText[ nCount ]
nPos += iif( oItem:lSoftCR, 0 , nEol ) + Len( oItem:cText )
nPos += iif( oItem:lSoftCR, 0, nEol ) + Len( oItem:cText )
NEXT
ELSE
FOR nCount := 1 TO ::nRow - 1

View File

@@ -38,10 +38,10 @@ MEMVAR __nCBid__, __temp__
WIDTH <nWidth> => ;
;
;
__nCBid__ := wvw_cbCreate( NIL, <row> , <col> , <nWidth> , ;
<aOptions> , ;
__nCBid__ := wvw_cbCreate( NIL, <row>, <col>, <nWidth>, ;
<aOptions>, ;
{| nWinNum, nId, nEvent, nIndex, temp | ;
CBhandler( nWinNum, nId, nEvent, nIndex, <"var"> , GetList );
CBhandler( nWinNum, nId, nEvent, nIndex, <"var">, GetList );
}, ;
NIL, NIL, s_nCB_Kbd, NIL ); ;
AAdd( s_aComboList, { __nCBid__, <"var"> } ); ;

View File

@@ -83,7 +83,7 @@ PROCEDURE Main()
nmidver := Int( ( ntop + nbot ) / 2 ), ;
nmidhor := Int( ( nleft + nrig ) / 2 )
LOCAL cpict := "vouch1.gif", ;
ltransp := .F. , ;
ltransp := .F., ;
nMaxCache := wvw_SetMaxBMcache()
LOCAL i, j, oWPaint
LOCAL getlist := {}

View File

@@ -33,7 +33,7 @@
[<multiline: MULTILINE>] ;
[PICTURE <pic>] ;
;
=> AddEBGet( aEBGets, <row>, <col>, @<var>, <"var"> , {| x | <var> := x }, <label>, <.multiline.>, <pic> )
=> AddEBGet( aEBGets, <row>, <col>, @<var>, <"var">, {| x | <var> := x }, <label>, <.multiline.>, <pic> )
//***************************
// constants to aEBGets member,
@@ -620,14 +620,14 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
pFlag := .F. //x for clarity
IF mcvaltype == "N"
// RL 104
IF Left( AllTrim( InBuffer ) , 1 ) == "-" .AND. Val( InBuffer ) == 0
IF Left( AllTrim( InBuffer ), 1 ) == "-" .AND. Val( InBuffer ) == 0
NegativeZero := .T.
ENDIF
IF PCount() > 1
// Point Count For Numeric InputMask
FOR x := 1 TO Len( InBuffer )
CB := SubStr( InBuffer , x , 1 )
CB := SubStr( InBuffer, x, 1 )
IF CB == "." .OR. CB == ","
pc++
ENDIF
@@ -640,7 +640,7 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
// Find First Non-Blank Position
FOR x := 1 TO Len( InBuffer )
CB := SubStr( InBuffer , x , 1 )
CB := SubStr( InBuffer, x, 1 )
IF !( CB == " " )
fnb := x
EXIT
@@ -651,12 +651,12 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
BackInBuffer := InBuffer
OldChar := SubStr( InBuffer , icp + 1 , 1 )
OldChar := SubStr( InBuffer, icp + 1, 1 )
IF Len( InBuffer ) < Len( Mask )
InBufferLeft := Left( InBuffer , icp )
InBufferLeft := Left( InBuffer, icp )
InBufferRight := Right( InBuffer , Len( InBuffer ) - icp )
InBufferRight := Right( InBuffer, Len( InBuffer ) - icp )
IF CharMaskTekstOK( InBufferLeft + " " + InBufferRight, mcvaltype, Mask ) .AND. ;
!CharMaskTekstOK( InBufferLeft + InBufferRight, mcvaltype, Mask )
@@ -669,9 +669,9 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
IF Len( InBuffer ) > Len( Mask ) .AND. ;
Len( Mask ) > 0
InBufferLeft := Left( InBuffer , icp )
InBufferLeft := Left( InBuffer, icp )
InBufferRight := Right( InBuffer , Len( InBuffer ) - icp - 1 )
InBufferRight := Right( InBuffer, Len( InBuffer ) - icp - 1 )
InBuffer := InBufferLeft + InBufferRight
ENDIF
@@ -680,8 +680,8 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
OutBuffer := "" //x for clarity
BadEntry := .F. //x for clarity
FOR x := 1 TO Len( Mask )
CB := SubStr( InBuffer , x , 1 )
CM := SubStr( Mask , x , 1 )
CB := SubStr( InBuffer, x, 1 )
CM := SubStr( Mask, x, 1 )
DO CASE
CASE CM == "A" .OR. CM == "!"
@@ -747,7 +747,7 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
// RL 104
IF NegativeZero == .T.
Output := Transform( GetValFromText( wvw_ebgettext( mnwinnum, mnebid ), mcvaltype ) , Mask )
Output := Transform( GetValFromText( wvw_ebgettext( mnwinnum, mnebid ), mcvaltype ), Mask )
//x better:
ol := Len( Output )
@@ -757,13 +757,13 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
wvw_ebsettext( mnwinnum, mnebid, Output )
wvw_ebsetsel( mnwinnum, mnebid, At( ".", OutBuffer ) + dc, At( ".", OutBuffer ) + dc )
ELSE
wvw_ebsettext( mnwinnum, mnebid, Transform( GetValFromText( wvw_ebgettext( mnwinnum, mnebid ), mcvaltype ) , Mask ) )
wvw_ebsettext( mnwinnum, mnebid, Transform( GetValFromText( wvw_ebgettext( mnwinnum, mnebid ), mcvaltype ), Mask ) )
wvw_ebsetsel( mnwinnum, mnebid, At( ".", OutBuffer ) + dc, At( ".", OutBuffer ) + dc )
ENDIF
ELSE
IF pFlag == .T.
ncp := At( "." , wvw_ebgettext( mnwinnum, mnebid ) )
ncp := At( ".", wvw_ebgettext( mnwinnum, mnebid ) )
wvw_ebsetsel( mnwinnum, mnebid, ncp, ncp )
ELSE
// Restore Initial CaretPos
@@ -775,8 +775,8 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
// Skip Protected Characters
FOR x := 1 TO Len( OutBuffer )
CB := SubStr( OutBuffer , icp + x , 1 )
CM := SubStr( Mask , icp + x , 1 )
CB := SubStr( OutBuffer, icp + x, 1 )
CM := SubStr( Mask, icp + x, 1 )
IF !IsDigit( CB ) .AND. !IsAlpha( CB ) .AND. ;
( !( CB == " " ) .OR. ( CB == " " .AND. CM == " " ) )
@@ -794,12 +794,12 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
STATIC FUNCTION CharMaskTekstOK( cString, cvaltype, cMask )
LOCAL lPassed := .T. , CB, CM, x
LOCAL lPassed := .T., CB, CM, x
IF cvaltype == "D"
FOR x := 1 TO Min( Len( cString ), Len( cMask ) )
CB := SubStr( cString , x , 1 )
CM := SubStr( cMask , x , 1 )
CB := SubStr( cString, x, 1 )
CM := SubStr( cMask, x, 1 )
DO CASE
CASE CM == "9"
IF IsDigit( CB ) .OR. CB == " "
@@ -815,8 +815,8 @@ STATIC FUNCTION CharMaskTekstOK( cString, cvaltype, cMask )
ENDIF
FOR x := 1 TO Min( Len( cString ), Len( cMask ) )
CB := SubStr( cString , x , 1 )
CM := SubStr( cMask , x , 1 )
CB := SubStr( cString, x, 1 )
CM := SubStr( cMask, x, 1 )
DO CASE
// JK
CASE ( CM ) == "A" .OR. ( CM ) == "!"
@@ -846,10 +846,10 @@ STATIC FUNCTION CharMaskTekstOK( cString, cvaltype, cMask )
//from h_textbox.prg
STATIC FUNCTION GetValFromText( Text , mcvaltype )
STATIC FUNCTION GetValFromText( Text, mcvaltype )
// eg. GetValFromText( "999,999.99" ) --> 999999.99
LOCAL x , c , s
LOCAL x, c, s
IF mcvaltype == "C"
RETURN TEXT
@@ -884,7 +884,7 @@ STATIC FUNCTION GetValFromText( Text , mcvaltype )
STATIC FUNCTION GetNumMask( Text, mcvaltype )
// eg. GetNumMask( "999,999.99" ) --> "999999.99"
LOCAL i , c , s
LOCAL i, c, s
IF mcvaltype == "D" .OR. mcvaltype == "C"
s := Text

View File

@@ -78,7 +78,7 @@ PROCEDURE updatescr()
FUNCTION WVW_SIZE( nWinNum, hWnd, message, wParam, lParam )
LOCAL cScreen
LOCAL lNeedReset := .F. , ;
LOCAL lNeedReset := .F., ;
maxsavedscrrow, maxsavedscrcol
IF !s_lSizeReady
// program is not ready to handle window resizing

View File

@@ -93,7 +93,7 @@ PROCEDURE xGet1()
FUNCTION xBrowse1()
LOCAL nKey, bBlock, oBrowse , i
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {}
LOCAL nTop := 6

View File

@@ -117,7 +117,7 @@ PROCEDURE xGet1()
FUNCTION xBrowse1()
LOCAL nKey, bBlock, oBrowse , i
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {}
LOCAL nTop := 6

View File

@@ -125,7 +125,7 @@ PROCEDURE xGet1()
FUNCTION xBrowse1()
LOCAL nKey, bBlock, oBrowse , i
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {}
LOCAL nTop := 6

View File

@@ -226,20 +226,20 @@ PROCEDURE Main()
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_RESET, "~Reset Toolbar" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_DELETE, "~Delete Toolbar" )
WVW_AppendMenu( hMenu , MF_ENABLED + MF_POPUP , hPopupMenu , "~Toolbar", )
WVW_AppendMenu( hMenu , MF_ENABLED + MF_POPUP , hPopupMenu, "~Toolbar", )
hPopupMenu := WVW_CreateMenu( )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_DECREASE, "~Decrease Line Spacing (F9)" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_INCREASE, "~Increase Line Spacing (F10)" )
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_DEFAULT, "~Set As Default Line Spacing (F11)" )
WVW_AppendMenu( hMenu , MF_ENABLED + MF_POPUP , hPopupMenu , "~Window", )
WVW_AppendMenu( hMenu , MF_ENABLED + MF_POPUP , hPopupMenu, "~Window", )
hPopupMenu := WVW_CreateMenu( )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_HELP_HELP, "~Help (F1)" )
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_HELP_INFO, "~Info (F2)" )
WVW_AppendMenu( hMenu , MF_ENABLED + MF_POPUP , hPopupMenu , "~Help", )
WVW_AppendMenu( hMenu , MF_ENABLED + MF_POPUP , hPopupMenu, "~Help", )
WVW_SetMenu( , hMenu )
@@ -250,10 +250,10 @@ PROCEDURE Main()
CreateToolbar( nCurWindow )
ResetMiscObjects( nCurWindow )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawLabel( nWindow, 1,40, cLabel,6,, rgb(255,255,255 ), rgb(198,198,198 ), "Arial", s_afontinfo[2], , , , , .T. , .T. ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawLabel( nWindow, 1, 40, cLabel, 6,, rgb( 255, 255, 255 ), rgb( 198, 198, 198 ), "Arial", s_afontinfo[ 2 ], , , , , .T. , .T. ) } )
wvwm_ResetMouseObjects( nCurWindow )
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New( "Info!", MaxRow() - 2,67, , , {|| xDebugInfo() } ) )
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New( "Info!", MaxRow() - 2, 67, , , {|| xDebugInfo() } ) )
oMouse := WVWMouseButton():New( "Flat", MaxRow() - 2, 67 - 11, , , {|| lboxmessage( "flat" ) }, 1, NIL )
oMouse:cImage := "vouch1.gif"
@@ -264,7 +264,7 @@ PROCEDURE Main()
oMouse:Enable( .T. )
wvwm_AddMouseObjects( nCurWindow, oMouse )
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New( "Hard", MaxRow() - 2,67 - 11 - 11 - 11, , , {|| lboxmessage("hard" ) }, 3, NIL ) )
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New( "Hard", MaxRow() - 2, 67 - 11 - 11 - 11, , , {|| lboxmessage( "hard" ) }, 3, NIL ) )
oMouse := WVWMouseButton():New( "Disabled", MaxRow() - 2, 67 - 11 - 11 - 11 - 11, , , {|| xDebugInfo() } )
oMouse:Enable( .F. )
wvwm_AddMouseObjects( nCurWindow, oMouse )
@@ -457,18 +457,18 @@ PROCEDURE Demo_Get()
WVW_SetIcon( , "vr_1.ico" )
ResetMiscObjects( nCurWindow )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawLabel( nWindow, 1,nRight - nLeft, cLabel,2,, rgb(255,255,255 ), rgb(198,198,198 ), "Arial", s_afontinfo[2], , , , , .T. , .T. ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawLabel( nWindow, 1,nRight - nLeft, cLabel,2,, rgb( 255, 255, 255 ), rgb( 198, 198, 198 ), "Arial", s_afontinfo[ 2 ], , , , , .T. , .T. ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxRecessed( nWindow, 7 - nTop, 61 - nLeft, 13 - nTop, 70 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxGroup( nWindow, 15 - nTop, 59 - nLeft, 18 - nTop, 72 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxGroup( nWindow, 5 - nTop, 6 - nLeft, 19 - nTop, 44 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawImage( nWindow, 8 - nTop,62 - nLeft,12 - nTop,69 - nLeft, "vouch1.bmp" ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawImage( nWindow, 8 - nTop,62 - nLeft, 12 - nTop,69 - nLeft, "vouch1.bmp" ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxRecessed( nWindow, 7 - nTop, 48 - nLeft, 13 - nTop, 55 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | x := nWindow, AEval( GetList, {| oGet | WVW_DrawBoxGet( x, oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
wvwm_ResetMouseObjects( nCurWindow )
/* we now use native push button
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New("Info", maxrow()-1,maxcol()-15, , , {|| xDebugInfo() } ))
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New("Info", maxrow() - 1, maxcol() - 15, , , {|| xDebugInfo() } ))
*/
WVW_PBcreate( nCurWindow, MaxRow() - 1, MaxCol() - 15, MaxRow() - 1, MaxCol() - 5, "Info", NIL, {|| xDebugInfo() }, NIL )
@@ -503,7 +503,7 @@ PROCEDURE Demo_Get()
FUNCTION DEMO_Browse()
LOCAL nKey, bBlock, oBrowse , i
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {} //WVW_nOpenWindow() has not been performed, so...
LOCAL nTop := 3 //pls notice that this is relative to PARENT window!
@@ -573,7 +573,7 @@ FUNCTION DEMO_Browse()
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawGridVert( nWindow, oBrowse:nTop, oBrowse:nBottom, aColumnsSep, Len( aColumnsSep ) ) } )
/* we now use native push button
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New("Info", maxrow(),maxcol()-15, , , {|| xDebugInfo() } ))
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New("Info", maxrow(), maxcol() - 15, , , {|| xDebugInfo() } ))
*/
WVW_PBcreate( nCurWindow, MaxRow(), MaxCol() - 15, MaxRow(), MaxCol() - 5, "Info", NIL, {|| xDebugInfo() }, NIL )
@@ -1219,7 +1219,7 @@ FUNCTION nCeiling( nNumber, nRoundDec )
FUNCTION SetDefaultWindowSize()
//x was: LOCAL Result:= SetMode(32,98), ScreenWidth
LOCAL Result := .T. , ScreenWidth
LOCAL Result := .T., ScreenWidth
SetMode( 25, 80 )
IF Result
screenWidth := Wvw_GetScreenWidth()
@@ -1262,7 +1262,7 @@ PROCEDURE ErrorSys()
STATIC PROCEDURE MyError( e )
LOCAL cTrace := "", i := 1 , cErr
LOCAL cTrace := "", i := 1, cErr
cErr := "Runtime error" + hb_eol() + ;
hb_eol() + ;

View File

@@ -66,7 +66,7 @@ __defaultNIL( @cId, "" )
cString := pdfStringB( cString )
IF right( cString, 1 ) == Chr( 255 ) //reverse
cString := left( cString, len( cString ) - 1 )
pdfBox( t_aReport[ PAGEY ] - nRow - t_aReport[ FONTSIZE ] + 2.0 , nCol, t_aReport[ PAGEY ] - nRow + 2.0, nCol + pdfM2X( pdfLen( cString )) + 1,,100, "D")
pdfBox( t_aReport[ PAGEY ] - nRow - t_aReport[ FONTSIZE ] + 2.0, nCol, t_aReport[ PAGEY ] - nRow + 2.0, nCol + pdfM2X( pdfLen( cString )) + 1,,100, "D")
t_aReport[ PAGEBUFFER ] += " 1 g "
lReverse := .T.
ELSEIF right( cString, 1 ) == Chr( 254 ) //underline

View File

@@ -25,9 +25,9 @@ PROCEDURE Main()
aStyle := { "Normal", "Bold", "Italic", "BoldItalic" }
aFonts := {;
{ "Times", .T. , .T. , .T. , .T. }, ;
{ "Helvetica", .T. , .T. , .T. , .T. }, ;
{ "Courier", .T. , .T. , .T. , .T. } }
{ "Times", .T., .T., .T., .T. }, ;
{ "Helvetica", .T., .T., .T., .T. }, ;
{ "Courier", .T., .T., .T., .T. } }
pdfOpen( "test.pdf", 200, .T. )

View File

@@ -90,7 +90,7 @@ STATIC FUNCTION ShowServerInfo()
cHtml += "<br>"
cHtml += DisplayVars( _Cookie , "COOKIE Vars" )
cHtml += "<br>"
// cHtml += DisplayVars( _Files , "FILE Vars" )
// cHtml += DisplayVars( _Files , "FILE Vars" )
// cHtml += "<br>"
cHtml += DisplayVars( _Request , "REQUEST Vars" )
cHtml += "<br>"

View File

@@ -188,7 +188,7 @@ STATIC FUNCTION CreateCounter( cValue, cBaseImage )
// Set the digit as tile that I have to use to fill position in counter
oI:SetTile( oTemp )
// Fill the position with the image digit
oI:Rectangle( ( n - 1 ) * nNumWidth, 0, ( n - 1 ) * nNumWidth + nNumWidth, nHeight, .T. , gdTiled )
oI:Rectangle( ( n - 1 ) * nNumWidth, 0, ( n - 1 ) * nNumWidth + nNumWidth, nHeight, .T., gdTiled )
NEXT
/* Write Final Counter Image */

View File

@@ -54,13 +54,13 @@ PROCEDURE Main()
CASE nCounter == 1
AChoice( 2, 1, 3, 11, aMenu1 )
CASE nCounter == 2
AChoice( 2, 13, 3, 23, aMenu2, .T. , "cUF" )
AChoice( 2, 13, 3, 23, aMenu2, .T., "cUF" )
CASE nCounter == 3
AChoice( 2, 25, 3, 35, aMenu3, .T. )
CASE nCounter == 4
// User function cUF2() fill screen with exclamation marks
// in clipper it does not get called in AC_NOITEM mode
AChoice( 2, 37, 3, 47, aMenu4, .T. , "cUF2" )
AChoice( 2, 37, 3, 47, aMenu4, .T., "cUF2" )
ENDCASE

View File

@@ -39,7 +39,7 @@ STATIC FUNCTION TestIt( cSpec )
OutStd( "--------------------------------------------------------" )
OutStd( hb_eol() )
ADir( cSpec , a1, a2, a3, a4, a5 )
ADir( cSpec, a1, a2, a3, a4, a5 )
AEval( a1, {| tmp | OutStd( tmp ), OutStd( hb_eol() ) } )
AEval( a2, {| tmp | OutStd( tmp ), OutStd( hb_eol() ) } )

View File

@@ -12,13 +12,13 @@ PROCEDURE Main()
ENDIF
? "Testing .T. .T."
AndOr( .T. , .T. )
AndOr( .T., .T. )
? "Testing .T. .F."
AndOr( .T. , .F. )
AndOr( .T., .F. )
? "Testing .F. .F."
AndOr( .F. , .F. )
AndOr( .F., .F. )
? "Testing errors..."
AndOr( 1, .T. )

View File

@@ -48,7 +48,7 @@ FUNCTION TestBrw( nRowIni )
IF nKey == 27 .OR. nKey == 13
EXIT
ELSEIF nKey == -1
s_lFixPos := iif( s_lFixPos, .F. , .T. )
s_lFixPos := iif( s_lFixPos, .F., .T. )
EXIT
ELSEIF nKey == 24
oBrw:Down()

View File

@@ -13,7 +13,7 @@ PROCEDURE Main()
// First, try all the types. This checks that the VM can cope.
AEval( { NIL, {}, "", 0, CToD( "" ), .F. , {|| NIL }, ErrorNew() }, ;
AEval( { NIL, {}, "", 0, CToD( "" ), .F., {|| NIL }, ErrorNew() }, ;
{| x | QOut( x:className ) } )
// Now try against values "in the code". This checks that the

View File

@@ -230,9 +230,9 @@ PROCEDURE Main()
? "Parameters info:"
? "================"
?
? ' _pcount() with Params1( 1, "a", .T., 10 ) =>', Params1( 1, "a", .T. , 10 )
? ' _parinfo() with Params2( 1, "a", .T., 0 ) =>', Params2( 1, "a", .T. , 0 )
? ' _parinfo() with Params2( 1, "a", .T., 3 ) =>', Params2( 1, "a", .T. , 3 ), "( IT_LOGICAL )"
? ' _pcount() with Params1( 1, "a", .T., 10 ) =>', Params1( 1, "a", .T., 10 )
? ' _parinfo() with Params2( 1, "a", .T., 0 ) =>', Params2( 1, "a", .T., 0 )
? ' _parinfo() with Params2( 1, "a", .T., 3 ) =>', Params2( 1, "a", .T., 3 ), "( IT_LOGICAL )"
?
?
?

View File

@@ -13,7 +13,7 @@ PROCEDURE Main()
SET EXCLUSIVE OFF
CLS
dbUseArea( .T. , "DBF", "test", "TESTDBF", .T. , .F. )
dbUseArea( .T., "DBF", "test", "TESTDBF", .T., .F. )
? "RecCount:", TESTDBF->( RecCount() )
? "Used:", TESTDBF->( Used() )
? "Select:", TESTDBF->( Select() )
@@ -41,7 +41,7 @@ PROCEDURE Main()
aArray := TESTDBF->( dbStruct() )
? "dbStruct:"
FOR nI := 1 TO Len( aArray )
? PadR( aArray[ nI ][ 1 ], 10 ) , aArray[ nI ][ 2 ], aArray[ nI ][ 3 ], aArray[ nI ][ 4 ]
? PadR( aArray[ nI ][ 1 ], 10 ), aArray[ nI ][ 2 ], aArray[ nI ][ 3 ], aArray[ nI ][ 4 ]
NEXT
? "Press any key to continue..."
@@ -223,7 +223,7 @@ PROCEDURE Main()
{ "Date", "D", 8, 0 }, ;
{ "Rate", "N", 6, 2 }, ;
{ "Memo", "M", 10, 0 }, ;
{ "Student", "L", 1, 0 } }, "DBFCDX", .T. , "newrdd" )
{ "Student", "L", 1, 0 } }, "DBFCDX", .T., "newrdd" )
SET CENTURY ON
? "lUpdate:", NEWRDD->( LUpdate() )
@@ -309,7 +309,7 @@ PROCEDURE Main()
? '? "RecCount:", NEWRDD->( RecCount() )'
? ""
NEWRDD->( dbCloseArea() )
dbUseArea( .T. , "DBFCDX", "newrdd", "NEWRDD", .F. , .F. )
dbUseArea( .T., "DBFCDX", "newrdd", "NEWRDD", .F., .F. )
? "Press any key to continue..."
Inkey( 0 )
@@ -359,7 +359,7 @@ PROCEDURE Main()
SELECT( "TESTDBF" )
SORT ON FIRST /DC, AGE /D TO newrdd
dbUseArea( .T. , "DBF", "newrdd", "NEWRDD", .F. , .F. )
dbUseArea( .T., "DBF", "newrdd", "NEWRDD", .F., .F. )
? "RecCount:", NEWRDD->( RecCount() )
FOR nI := 1 TO 8
? NEWRDD->FIRST, NEWRDD->AGE

View File

@@ -14,7 +14,7 @@ PROCEDURE Main()
LOCAL aTest0 := { "This", "is", "a", "browse", "on", "an", "array", "test", "with", "a", "long", "data" }
LOCAL aTest1 := { 1, 2, 3, 4, 5, 6, 7, 8, 10000, - 1000, 54, 456342 }
LOCAL aTest2 := { Date(), Date() + 4, Date() + 56, Date() + 14, Date() + 5, Date() + 6, Date() + 7, Date() + 8, Date() + 10000, Date() - 1000, Date() - 54, Date() + 456342 }
LOCAL aTest3 := { .T. , .F. , .T. , .T. , .F. , .F. , .T. , .F. , .T. , .T. , .F. , .F. }
LOCAL aTest3 := { .T., .F., .T., .T., .F., .F., .T., .F., .T., .T., .F., .F. }
LOCAL n := 1
LOCAL nCursor
LOCAL cColor

View File

@@ -13,8 +13,8 @@ PROCEDURE Main()
{ "LOGICAL", "L", 1, 0 } }
CLS
dbUseArea( .T. , "DBFCDX", "test", "TESTDBF", .T. , .F. )
dbCreate( "testcdx", aStruct, "DBFCDX", .T. , "TESTCDX" )
dbUseArea( .T., "DBFCDX", "test", "TESTDBF", .T., .F. )
dbCreate( "testcdx", aStruct, "DBFCDX", .T., "TESTCDX" )
? "RddName:", rddName()
// ? "Press any key to continue..."

View File

@@ -15,7 +15,7 @@ PROCEDURE Main()
REQUEST DBFCDX
dbCreate( "testdbf", aStruct, "DBFCDX", .T. , "MYALIAS" )
dbCreate( "testdbf", aStruct, "DBFCDX", .T., "MYALIAS" )
? "[" + MYALIAS->MEMO1 + "]"
? "[" + MYALIAS->MEMO2 + "]"
@@ -75,7 +75,7 @@ PROCEDURE Main()
Inkey( 0 )
dbCloseAll()
dbCreate( "testdbf", aStruct, , .T. , "MYALIAS" )
dbCreate( "testdbf", aStruct, , .T., "MYALIAS" )
FOR nI := 1 TO 10
MYALIAS->( dbAppend() )

View File

@@ -219,11 +219,11 @@ PROC tofix()
? transtest( 1234.56789, "@D", "1234.56:79" )
? transtest( 123.345678912, "@D ", " 123.34:57" )
SET( _SET_DATEFORMAT, "MM-DD-YYYY" )
? transtest( .T. , "@RE <|,yY#lL,|>", "99-99-9999T" )
? transtest( .F. , "@RE <|,yY#lL,|>", "99-99-9999F" )
? transtest( .T. , "@RD <|,yY#lL,|>", "99-99-9999T" )
? transtest( .F. , "@RD <|,yY#lL,|>", "99-99-9999F" )
? transtest( .F. , "@DE <|,yY#lL,|>", "9" )
? transtest( .T., "@RE <|,yY#lL,|>", "99-99-9999T" )
? transtest( .F., "@RE <|,yY#lL,|>", "99-99-9999F" )
? transtest( .T., "@RD <|,yY#lL,|>", "99-99-9999T" )
? transtest( .F., "@RD <|,yY#lL,|>", "99-99-9999F" )
? transtest( .F., "@DE <|,yY#lL,|>", "9" )
? transtest( "abcdefghij", "@S15! <XXXXXXXX>", "<BCDEFGHI>" )
? transtest( "abcdefghij", "@S0! <XXXXXXXX>", "<BCDEFGHI>" )
? transtest( "abcdefghij", "@S5! <XXXXXXXX>", "<BCDE" )

View File

@@ -8,7 +8,7 @@ PROCEDURE Main()
LOCAL a := { 3, 2, 1 }
LOCAL b := { 10 }
LOCAL c := { 2, .T. , "B", NIL, { 1 }, {|| b }, oError, Date(), 1, .F. , "A", NIL, Date() - 1, { 0 }, {|| a }, oError }
LOCAL c := { 2, .T., "B", NIL, { 1 }, {|| b }, oError, Date(), 1, .F., "A", NIL, Date() - 1, { 0 }, {|| a }, oError }
?
?

View File

@@ -79,7 +79,7 @@ PROCEDURE Main()
WAIT
#else
? "Create it and leave opened"
dbCreate( "arrtest.dbf", aStruct, "ARRAYRDD", .T. , "arrtest" )
dbCreate( "arrtest.dbf", aStruct, "ARRAYRDD", .T., "arrtest" )
WAIT
#endif

View File

@@ -22,7 +22,7 @@ PROCEDURE Main()
{ "SALARY", "N", 6, 0 }, ;
{ "NOTES", "C", 70, 0 } } )
USE _tst
HSX_CREATE( "_tst", "FIRST+LAST+STREET+CITY", 2, 0, .T. , 3 )
HSX_CREATE( "_tst", "FIRST+LAST+STREET+CITY", 2, 0, .T., 3 )
APPEND FROM test
/* Look for all records which have 'SHERMAN' string inside */