2012-07-23 17:17 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/tests/demoxbp.prg
* contrib/gtwvg/tests/wvgactivex.prg
* contrib/gtwvg/tests/wvgmodal.prg
* contrib/gtwvg/tests/wvgxbp.prg
* contrib/gtwvg/wvgcheck.prg
* contrib/hbide/ideconsole.prg
* contrib/hbide/idetags.prg
* contrib/hbnf/tests/nftest.prg
* contrib/hbxbp/tests/demoxbp.prg
* contrib/hbxbp/tests/dialogqt.prg
* contrib/hbxbp/tests/xbpqtc.prg
* contrib/hbxbp/xbpappevent.prg
* contrib/hbxbp/xbptreeview.prg
* contrib/xhb/hjwindow.prg
* contrib/xhb/hterrsys.prg
* contrib/xhb/htjlist.prg
* contrib/xhb/htmutil.prg
* contrib/xhb/ttable.prg
* contrib/xhb/xhberr.prg
* extras/gtwvw/tests/cbtest6.prg
* extras/guestbk/cgi.ch
* extras/guestbk/guestbk.prg
* extras/guestbk/guestbk.txt
* extras/guestbk/inifiles.prg
* extras/hbapollo/fblock.prg
* extras/hbapollo/tests/test45.prg
* extras/hbxlsxml/xlsxml_y.prg
* extras/httpsrv/cgifunc.prg
* extras/httpsrv/session.prg
* extras/httpsrv/uhttpd.prg
! if() -> iif()
* formatting
* *trim( str() ) -> hb_ntos()
* modernized generated html
This commit is contained in:
@@ -16,6 +16,42 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-07-23 17:17 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/gtwvg/tests/demoxbp.prg
|
||||
* contrib/gtwvg/tests/wvgactivex.prg
|
||||
* contrib/gtwvg/tests/wvgmodal.prg
|
||||
* contrib/gtwvg/tests/wvgxbp.prg
|
||||
* contrib/gtwvg/wvgcheck.prg
|
||||
* contrib/hbide/ideconsole.prg
|
||||
* contrib/hbide/idetags.prg
|
||||
* contrib/hbnf/tests/nftest.prg
|
||||
* contrib/hbxbp/tests/demoxbp.prg
|
||||
* contrib/hbxbp/tests/dialogqt.prg
|
||||
* contrib/hbxbp/tests/xbpqtc.prg
|
||||
* contrib/hbxbp/xbpappevent.prg
|
||||
* contrib/hbxbp/xbptreeview.prg
|
||||
* contrib/xhb/hjwindow.prg
|
||||
* contrib/xhb/hterrsys.prg
|
||||
* contrib/xhb/htjlist.prg
|
||||
* contrib/xhb/htmutil.prg
|
||||
* contrib/xhb/ttable.prg
|
||||
* contrib/xhb/xhberr.prg
|
||||
* extras/gtwvw/tests/cbtest6.prg
|
||||
* extras/guestbk/cgi.ch
|
||||
* extras/guestbk/guestbk.prg
|
||||
* extras/guestbk/guestbk.txt
|
||||
* extras/guestbk/inifiles.prg
|
||||
* extras/hbapollo/fblock.prg
|
||||
* extras/hbapollo/tests/test45.prg
|
||||
* extras/hbxlsxml/xlsxml_y.prg
|
||||
* extras/httpsrv/cgifunc.prg
|
||||
* extras/httpsrv/session.prg
|
||||
* extras/httpsrv/uhttpd.prg
|
||||
! if() -> iif()
|
||||
* formatting
|
||||
* *trim( str() ) -> hb_ntos()
|
||||
* modernized generated html
|
||||
|
||||
2012-07-23 16:52 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* src/lang/msgelutf.c
|
||||
* src/lang/msgko.c
|
||||
|
||||
@@ -122,7 +122,7 @@ FUNCTION Main()
|
||||
oTree:create()
|
||||
oTree:setColorBG( RGB( 120,15,240 ) )
|
||||
oTree:setColorFG( RGB( 15,240,120 ) )
|
||||
oTree:itemSelected := {|oItem| IF( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) }
|
||||
oTree:itemSelected := {|oItem| iif( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) }
|
||||
|
||||
oItem1 := oTree:rootItem:addItem( "First level A" )
|
||||
|
||||
@@ -185,7 +185,7 @@ FUNCTION Main()
|
||||
oRadio := WvgRadioButton():new( oStatic2,, { 10,10 }, { 100,15 } )
|
||||
oRadio:caption := "Com 1"
|
||||
oRadio:selection := .T.
|
||||
oRadio:selected := {|m1,m2,obj| m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + IF( obj:selection, '< S >', '< N >' ) ) }
|
||||
oRadio:selected := {|m1,m2,obj| m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
|
||||
oRadio:create()
|
||||
|
||||
oRadio := WvgRadioButton():new( oStatic2,, { 10,35 }, { 100,15 } )
|
||||
@@ -195,7 +195,7 @@ FUNCTION Main()
|
||||
oCheck := WvgCheckBox():New( oStatic2, , { 10,70 }, { 100,15 }, , .t. )
|
||||
oCheck:caption := 'Checkbox A'
|
||||
oCheck:create()
|
||||
oCheck:selected := {|m1,m2,o| m1:=m1,m2:=m2, WVG_MessageBox( , IF( o:getData(), 'I am selected','I am not selected' ) ) }
|
||||
oCheck:selected := {|m1,m2,o| m1:=m1,m2:=m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
|
||||
|
||||
// Create first 3State button, passing the position to :create()
|
||||
oXbp := Wvg3State():new()
|
||||
@@ -245,11 +245,11 @@ FUNCTION Main()
|
||||
oMLE:setData()
|
||||
|
||||
//--------------------------- Misc Config ------------------------\\
|
||||
oTBar:buttonClick := {|oBtn| IF( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
|
||||
IF( oBtn:caption == 'Show' , oStatic:show(), nil ),;
|
||||
IF( oBtn:caption == 'Tools' , oStatic2:show():toFront(), nil ),;
|
||||
IF( oBtn:caption == 'FontDlg', ExeFontDialog( oCrt ), nil ),;
|
||||
IF( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
|
||||
oTBar:buttonClick := {|oBtn| iif( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
|
||||
iif( oBtn:caption == 'Show' , oStatic:show(), nil ),;
|
||||
iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), nil ),;
|
||||
iif( oBtn:caption == 'FontDlg', ExeFontDialog( oCrt ), nil ),;
|
||||
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
|
||||
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
|
||||
|
||||
oCrt:resize := {|| ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr ) }
|
||||
@@ -325,7 +325,7 @@ Static Function ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
|
||||
|
||||
oSubMenu := WvgMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "F~eatures"
|
||||
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| IF( oStatic:isVisible, ;
|
||||
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| iif( oStatic:isVisible, ;
|
||||
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE,0,0 ) } } )
|
||||
oSubMenu:addItem( { "~Show My Panel" , {|| oStatic2:show():toFront() } } )
|
||||
oSubMenu:addItem()
|
||||
|
||||
@@ -86,7 +86,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
|
||||
oRadio := WvgRadioButton():new( oStatic2,, { 10,10 }, { 100,15 } )
|
||||
oRadio:caption := "Com 1"
|
||||
oRadio:selection := .T.
|
||||
oRadio:selected := {|m1,m2,obj| m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + IF( obj:selection, '< S >', '< N >' ) ) }
|
||||
oRadio:selected := {|m1,m2,obj| m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
|
||||
oRadio:create()
|
||||
|
||||
oRadio := WvgRadioButton():new( oStatic2,, { 10,35 }, { 100,15 } )
|
||||
@@ -96,7 +96,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
|
||||
oCheck := WvgCheckBox():New( oStatic2, , { 10,70 }, { 100,15 }, , .t. )
|
||||
oCheck:caption := 'Checkbox A'
|
||||
oCheck:create()
|
||||
oCheck:selected := {|m1,m2,o| m1:=m1,m2:=m2, WVG_MessageBox( , IF( o:getData(), 'I am selected','I am not selected' ) ) }
|
||||
oCheck:selected := {|m1,m2,o| m1:=m1,m2:=m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
|
||||
|
||||
// Create first 3State button, passing the position to :create()
|
||||
oXbp := Wvg3State():new( oStatic2 )
|
||||
@@ -188,7 +188,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
|
||||
oTree:create()
|
||||
oTree:setColorBG( RGB( 120,15,240 ) )
|
||||
oTree:setColorFG( RGB( 15,240,120 ) )
|
||||
oTree:itemSelected := {|oItem| IF( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) }
|
||||
oTree:itemSelected := {|oItem| iif( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) }
|
||||
|
||||
oItem1 := oTree:rootItem:addItem( "First level A" )
|
||||
|
||||
@@ -210,10 +210,10 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
|
||||
oTree:setData( oItem2 )
|
||||
|
||||
//--------------------------- Misc Config ------------------------\\
|
||||
oTBar:buttonClick := {|oBtn| IF( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
|
||||
IF( oBtn:caption == 'Show' , oStatic:show(), nil ),;
|
||||
IF( oBtn:caption == 'Tools', oStatic2:show():toFront(), nil ),;
|
||||
IF( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
|
||||
oTBar:buttonClick := {|oBtn| iif( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
|
||||
iif( oBtn:caption == 'Show' , oStatic:show(), nil ),;
|
||||
iif( oBtn:caption == 'Tools', oStatic2:show():toFront(), nil ),;
|
||||
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
|
||||
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
|
||||
oDA:resize := {|| ResizeDialog( oCrt, oTBar, oSBar, oStatic, oCom, oTree ) }
|
||||
|
||||
@@ -296,7 +296,7 @@ Static Function ActiveXBuildMenu( oCrt, oStatic, oStatic2 )
|
||||
|
||||
oSubMenu := WvgMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "F~eatures"
|
||||
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| IF( oStatic:isVisible, ;
|
||||
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| iif( oStatic:isVisible, ;
|
||||
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE,0,0 ) } } )
|
||||
oSubMenu:addItem( { "~Show My Panel" , {|| oStatic2:show() } } )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
@@ -344,7 +344,7 @@ STATIC FUNCTION BuildActiveXControl( nActiveX, oDA )
|
||||
oCom:showAboutBox() ;
|
||||
} )
|
||||
|
||||
oCom:mapEvent( evBtnUp, {|nBtn| if( nBtn == 2, oCom:oParent:sendMessage( WM_CLOSE,0,0 ), NIL ) } )
|
||||
oCom:mapEvent( evBtnUp, {|nBtn| iif( nBtn == 2, oCom:oParent:sendMessage( WM_CLOSE,0,0 ), NIL ) } )
|
||||
|
||||
case nActiveX == 3
|
||||
hb_gtInfo( HB_GTI_WINTITLE, 'file://' + hb_DirBase() + 'myharu.pdf' )
|
||||
|
||||
@@ -115,9 +115,9 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime )
|
||||
aButtons_:= {aButtons_}
|
||||
endif
|
||||
|
||||
nLinesRqd := len( aText_ )+ if( len( aText_ )== 0, 4, 5 )
|
||||
nLinesRqd := len( aText_ )+ iif( len( aText_ )== 0, 4, 5 )
|
||||
nTopReq := int( ( maxRow - nLinesRqd ) / 2 )
|
||||
nTop := if( nTop == nil, nTopReq, if( nTop > nTopReq, nTop, nTopReq ) )
|
||||
nTop := iif( nTop == nil, nTopReq, iif( nTop > nTopReq, nTop, nTopReq ) )
|
||||
nBottom := nTop + nLinesRqd - 1 // 1 for shadow
|
||||
|
||||
// check for columns
|
||||
@@ -135,7 +135,7 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime )
|
||||
nColRqd := 0
|
||||
aeval( { nColCap, nColTxt, nColBut }, {|e| nColRqd := max( nColRqd, e ) } )
|
||||
|
||||
nLeft := IF( maxCol > nColRqd, int( ( maxCol - nColRqd ) / 2 ), 0 )
|
||||
nLeft := iif( maxCol > nColRqd, int( ( maxCol - nColRqd ) / 2 ), 0 )
|
||||
nRight := nLeft+nColRqd
|
||||
|
||||
aTrg_:= array( len( aButtons_ ) )
|
||||
@@ -151,7 +151,7 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime )
|
||||
nLeft := 0
|
||||
nBottom := nTop + nLinesRqd - 1
|
||||
nRight := nLeft + nColRqd
|
||||
nBtnRow := nTop + 1 + len( aText_ ) + if( len( aText_ ) == 0, 1, 2 )
|
||||
nBtnRow := nTop + 1 + len( aText_ ) + iif( len( aText_ ) == 0, 1, 2 )
|
||||
|
||||
nBtnCol_ := array( len( aButtons_ ) )
|
||||
|
||||
@@ -288,7 +288,7 @@ FUNCTION CreateOCrt( nT, nL, nB, nR, cTitle, xIcon, lModal, lRowCols, lHidden, ;
|
||||
DEFAULT lCenter TO .F.
|
||||
DEFAULT lNoTitleBar TO .F.
|
||||
|
||||
aPos := IF( lCenter, {-1,-1}, IF( nRow == NIL, { nT, nL }, { nRow,nCol } ) )
|
||||
aPos := iif( lCenter, {-1,-1}, iif( nRow == NIL, { nT, nL }, { nRow,nCol } ) )
|
||||
|
||||
oCrt := WvgCrt():new( , , aPos, { nB - nT, nR - nL }, , !lHidden )
|
||||
oCrt:lModal := lModal
|
||||
|
||||
@@ -120,7 +120,7 @@ FUNCTION demoxbp()
|
||||
oTree:create()
|
||||
oTree:setColorBG( RGB( 120,15,240 ) )
|
||||
oTree:setColorFG( RGB( 15,240,120 ) )
|
||||
oTree:itemSelected := {|oItem| IF( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) }
|
||||
oTree:itemSelected := {|oItem| iif( oItem != NIL, WVG_MessageBox( , oItem:caption ), NIL ) }
|
||||
|
||||
oItem1 := oTree:rootItem:addItem( "First level A" )
|
||||
|
||||
@@ -184,7 +184,7 @@ FUNCTION demoxbp()
|
||||
oRadio := WvgRadioButton():new( oStatic2,, { 10,10 }, { 100,15 } )
|
||||
oRadio:caption := "Com 1"
|
||||
oRadio:selection := .T.
|
||||
oRadio:selected := {|m1,m2,obj| m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + IF( obj:selection, '< S >', '< N >' ) ) }
|
||||
oRadio:selected := {|m1,m2,obj| m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
|
||||
oRadio:create()
|
||||
|
||||
oRadio := WvgRadioButton():new( oStatic2,, { 10,35 }, { 100,15 } )
|
||||
@@ -194,7 +194,7 @@ FUNCTION demoxbp()
|
||||
oCheck := WvgCheckBox():New( oStatic2, , { 10,70 }, { 100,15 }, , .t. )
|
||||
oCheck:caption := 'Checkbox A'
|
||||
oCheck:create()
|
||||
oCheck:selected := {|m1,m2,o| m1:=m1,m2:=m2, WVG_MessageBox( , IF( o:getData(), 'I am selected','I am not selected' ) ) }
|
||||
oCheck:selected := {|m1,m2,o| m1:=m1,m2:=m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
|
||||
|
||||
// Create first 3State button, passing the position to :create()
|
||||
oXbp := Wvg3State():new()
|
||||
@@ -244,11 +244,11 @@ FUNCTION demoxbp()
|
||||
oMLE:setData()
|
||||
|
||||
//--------------------------- Misc Config ------------------------\\
|
||||
oTBar:buttonClick := {|oBtn| IF( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
|
||||
IF( oBtn:caption == 'Show' , oStatic:show(), nil ),;
|
||||
IF( oBtn:caption == 'Tools' , oStatic2:show():toFront(), nil ),;
|
||||
IF( oBtn:caption == 'FontDlg', ExeFontDialogXbp( oCrt ), nil ),;
|
||||
IF( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
|
||||
oTBar:buttonClick := {|oBtn| iif( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
|
||||
iif( oBtn:caption == 'Show' , oStatic:show(), nil ),;
|
||||
iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), nil ),;
|
||||
iif( oBtn:caption == 'FontDlg', ExeFontDialogXbp( oCrt ), nil ),;
|
||||
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
|
||||
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
|
||||
|
||||
oCrt:resize := {|| ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr ) }
|
||||
@@ -325,7 +325,7 @@ STATIC FUNCTION ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
|
||||
|
||||
oSubMenu := WvgMenu():new( oMenuBar ):create()
|
||||
oSubMenu:title := "F~eatures"
|
||||
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| IF( oStatic:isVisible, ;
|
||||
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| iif( oStatic:isVisible, ;
|
||||
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE,0,0 ) } } )
|
||||
oSubMenu:addItem( { "~Show My Panel" , {|| oStatic2:show():toFront() } } )
|
||||
oSubMenu:addItem()
|
||||
|
||||
@@ -92,7 +92,7 @@ CLASS WvgCheckBox INHERIT WvgWindow, WvgDataRef
|
||||
#if 0
|
||||
METHOD editBuffer() INLINE ( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED )
|
||||
METHOD getData() INLINE ( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED )
|
||||
METHOD setData( lCheck ) INLINE ::sendMessage( BM_SETCHECK, IF( lCheck, BST_CHECKED, BST_UNCHECKED ), 0 )
|
||||
METHOD setData( lCheck ) INLINE ::sendMessage( BM_SETCHECK, iif( lCheck, BST_CHECKED, BST_UNCHECKED ), 0 )
|
||||
#endif
|
||||
METHOD setCaption( xCaption )
|
||||
|
||||
|
||||
@@ -2644,7 +2644,7 @@ METHOD hbCUIEditor:scrAddTxt( nMode )
|
||||
ENDIF
|
||||
|
||||
DO WHILE .t.
|
||||
IF( n := ascan( ::obj_, {|e_| e_[ OBJ_TYPE ] == OBJ_O_TEXT .AND. e_[ OBJ_ROW ] == ::nRowRep } ) ) > 0
|
||||
IF ( n := ascan( ::obj_, {|e_| e_[ OBJ_TYPE ] == OBJ_O_TEXT .AND. e_[ OBJ_ROW ] == ::nRowRep } ) ) > 0
|
||||
VouchAShrink( ::obj_,n )
|
||||
ELSE
|
||||
EXIT
|
||||
@@ -2654,7 +2654,7 @@ METHOD hbCUIEditor:scrAddTxt( nMode )
|
||||
aeval( txt_, {|e_| iif( e_[ OBJ_ROW ] > 0, aadd( ::obj_, e_ ), '' ) } )
|
||||
|
||||
DO WHILE .t.
|
||||
IF( n := ascan( ::obj_,{|e_| e_[ OBJ_TO_COL ] < e_[ OBJ_COL ] } ) ) > 0
|
||||
IF ( n := ascan( ::obj_,{|e_| e_[ OBJ_TO_COL ] < e_[ OBJ_COL ] } ) ) > 0
|
||||
VouchAShrink( ::obj_, n )
|
||||
ELSE
|
||||
EXIT
|
||||
@@ -3426,7 +3426,7 @@ STATIC FUNCTION scan_ff( elem, a_, c /*, nFrom */ )
|
||||
|
||||
c := lower( substr( c,1,1 ) )
|
||||
nLen := Len( c )
|
||||
IF( na := ascan( a_,{|e| lower( substr( ltrim( e ),1,nLen ) ) == c }, min( elem+1, Len( a_ ) ) ) ) == 0
|
||||
IF ( na := ascan( a_,{|e| lower( substr( ltrim( e ),1,nLen ) ) == c }, min( elem+1, Len( a_ ) ) ) ) == 0
|
||||
na := ascan( a_,{|e| lower( substr( ltrim( e ),1,nlen ) ) == c },1,elem-1 )
|
||||
ENDIF
|
||||
|
||||
@@ -3589,7 +3589,7 @@ FUNCTION VouchMenuMM( mnu_,nInit,msg,lExact,aSel )
|
||||
|
||||
aeval( mnu_,{|e_| aadd( m_,e_[ 1 ] ) } )
|
||||
|
||||
IF( t := valtype( nInit ) == 'C' )
|
||||
IF ( t := valtype( nInit ) ) == 'C'
|
||||
//nInit := iif( lExact, nInit, trim( nInit ) )
|
||||
ENDIF
|
||||
|
||||
@@ -3996,11 +3996,11 @@ FUNCTION VouchFunc2( nMode, nElem, nRel, nKey, cgo_ )
|
||||
cgo_[CGO_POS] := min( cgo_[CGO_POS]+1,Len( cgo_[CGO_CH_] ) )
|
||||
RETURN AC_ABORT
|
||||
ELSE
|
||||
IF( n:=val( substr( cgo_[CGO_CH_,cgo_[CGO_POS]],1,4 ) ) )>0
|
||||
IF ( n:=val( substr( cgo_[CGO_CH_,cgo_[CGO_POS]],1,4 ) ) )>0
|
||||
cgo_[CGO_CH_,cgo_[CGO_POS]] := " "+substr( cgo_[CGO_CH_,cgo_[CGO_POS]],5 )
|
||||
cgo_[CGO_POS] := min( cgo_[CGO_POS]+1,Len( cgo_[CGO_CH_] ) )
|
||||
FOR i := 1 TO Len( cgo_[CGO_CH_] )
|
||||
IF( nn := val( left( cgo_[CGO_CH_,i],4 ) ) )>0
|
||||
IF ( nn := val( left( cgo_[CGO_CH_,i],4 ) ) )>0
|
||||
IF nn > n
|
||||
nn := nn - 1
|
||||
s := iif( nn > 0,pad( hb_ntos( nn ),4 )," " )
|
||||
@@ -4578,7 +4578,7 @@ METHOD AChoiceNew:init( nTop, nLft, nBtm, nRgt, acItems, xSelect, ;
|
||||
::nAtTop := 1 // The number of the item at the top
|
||||
::nAtBtm := 1 // The number of the item at the bottom
|
||||
::nItems := 0 // The number of items
|
||||
::bScan := {| cX | IF( left( cX, 1 ) == upper( chr( ::nKey ) ), .T., .F. ) }
|
||||
::bScan := {| cX | iif( left( cX, 1 ) == upper( chr( ::nKey ) ), .T., .F. ) }
|
||||
::lUserFunc := ( !empty( ::cUserFunc ) )
|
||||
::nUserFunc := 0 // RETURN value FROM user FUNCTION
|
||||
::bUserFunc := {|| AC_ABORT } // Block form of user FUNCTION
|
||||
@@ -4605,7 +4605,7 @@ METHOD AChoiceNew:init( nTop, nLft, nBtm, nRgt, acItems, xSelect, ;
|
||||
::nNumCols := ::nRight - ::nLeft + 1
|
||||
::nNumRows := ::nBottom - ::nTop + 1
|
||||
|
||||
aeval( ::acItems, {| x | IF( valtype( x ) == "C", aadd( ::acCopy, padr( x, ::nNumCols ) ), .F. ) } )
|
||||
aeval( ::acItems, {| x | iif( valtype( x ) == "C", aadd( ::acCopy, padr( x, ::nNumCols ) ), .F. ) } )
|
||||
::nItems := Len( ::acCopy )
|
||||
|
||||
::alSelect := array( ::nItems )
|
||||
@@ -4833,8 +4833,8 @@ METHOD AChoiceNew:DispPageNew()
|
||||
METHOD AChoiceNew:DispLineNew( nPos, nRow, lHiLite )
|
||||
|
||||
DispOutAt( nRow, ::nLeft, ::acCopy[ nPos ],;
|
||||
IF( ::alSelect[ nPos ], ;
|
||||
IF( lHiLite, ::cHiClr, ::cLoClr ), ::cUnClr ), ::oWin )
|
||||
iif( ::alSelect[ nPos ], ;
|
||||
iif( lHiLite, ::cHiClr, ::cLoClr ), ::cUnClr ), ::oWin )
|
||||
|
||||
RETURN SELF
|
||||
|
||||
|
||||
@@ -176,13 +176,13 @@ FUNCTION UpdateTags( cModule, aSummary, aSumData, aFuncList, aLines, aText )
|
||||
cModule ,;
|
||||
cSyntax ,;
|
||||
cType ,;
|
||||
Iif( LEFTEQUAL( cType, "METH" ), ":", "" ) + cSyntax, ;
|
||||
iif( LEFTEQUAL( cType, "METH" ), ":", "" ) + cSyntax, ;
|
||||
aText[ aSumData[ i,2 ] ] ;
|
||||
};
|
||||
)
|
||||
ENDIF
|
||||
|
||||
AAdd( aFuncList, { Iif( LEFTEQUAL( cType, "METH" ), ":", "" ) + cSyntax, aSumData[ i, 2 ], aSumData[ i, 1 ] } )
|
||||
AAdd( aFuncList, { iif( LEFTEQUAL( cType, "METH" ), ":", "" ) + cSyntax, aSumData[ i, 2 ], aSumData[ i, 1 ] } )
|
||||
AAdd( aLines, i )
|
||||
NEXT
|
||||
|
||||
|
||||
@@ -1084,6 +1084,6 @@ RETURN(.t.)
|
||||
?? ' '
|
||||
?? STR(aTest[nk, 3])
|
||||
?? ' '
|
||||
?? IF(aTest[nk, 4], 'true', 'false')
|
||||
?? iif(aTest[nk, 4], 'true', 'false')
|
||||
NEXT
|
||||
RETURN Nil
|
||||
|
||||
@@ -93,8 +93,8 @@ PROCEDURE Main()
|
||||
LOCAL q, a_, j
|
||||
LOCAL nTimes := 20
|
||||
LOCAL nLoops := 5
|
||||
|
||||
FOR j := 1 TO nLoops
|
||||
|
||||
FOR j := 1 TO nLoops
|
||||
msgbox( hb_ntos( j ) + " : Building start..." )
|
||||
a_:= {}
|
||||
FOR q := 1 TO nTimes
|
||||
@@ -106,20 +106,20 @@ PROCEDURE Main()
|
||||
//aadd( a_, QTreeWidget() )
|
||||
//aadd( a_, QMainWindow() )
|
||||
//aadd( a_, QWidget() )
|
||||
NEXT
|
||||
NEXT
|
||||
msgbox( "Destroying Starts..." )
|
||||
FOR q := 1 TO nTimes
|
||||
__hbqt_destroy( a_[ q ] )
|
||||
a_[ q ] := NIL
|
||||
NEXT
|
||||
NEXT
|
||||
msgbox( "Done" )
|
||||
__hbqt_destroy( a_[ q ] )
|
||||
a_[ q ] := NIL
|
||||
NEXT
|
||||
NEXT
|
||||
msgbox( "Done" )
|
||||
#else
|
||||
_BuildADialog()
|
||||
#endif
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
RETURN
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
FUNCTION _BuildADialog()
|
||||
@@ -278,7 +278,7 @@ STATIC FUNCTION uiXtoS( xVar )
|
||||
CASE cType == "D"
|
||||
RETURN dtoc( xVar )
|
||||
CASE cType == "L"
|
||||
RETURN IF( xVar, "Yes", "No" )
|
||||
RETURN iif( xVar, "Yes", "No" )
|
||||
CASE cType == "M"
|
||||
RETURN xVar
|
||||
CASE cType == "C"
|
||||
@@ -320,7 +320,7 @@ STATIC FUNCTION PP_Debug( oXbp )
|
||||
LOCAL s := ''
|
||||
|
||||
aeval( aPP, {|e_| s += ( hb_ntos( e_[ 1 ] ) +' '+ valtype( e_[ 2 ] ) +' '+ ;
|
||||
IF( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ CRLF ) } )
|
||||
iif( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ CRLF ) } )
|
||||
|
||||
MsgBox( s )
|
||||
|
||||
@@ -381,7 +381,7 @@ STATIC FUNCTION Build_MenuBar( oDlg )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
//
|
||||
oSubMenu:insItem( 2, { "This executes MsgBox()" , {|| MyFunctionXbp( 103 ) }, , XBPMENUBAR_MIA_CHECKED } )
|
||||
oSubMenu:itemMarked := {|mp1| IF( mp1 == 5, MsgBox( "WOW - ::itemMarked - Activated" ), NIL ) }
|
||||
oSubMenu:itemMarked := {|mp1| iif( mp1 == 5, MsgBox( "WOW - ::itemMarked - Activated" ), NIL ) }
|
||||
|
||||
/* Menu colors are being honored in Harbour only */
|
||||
// oSubMenu:setColorBG( GraMakeRGBColor( { 134,128,250 } ) )
|
||||
@@ -711,7 +711,7 @@ FUNCTION Build_RadioButton( oStatic )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION SetMaximized( aTabs, nMax )
|
||||
RETURN {|| aeval( aTabs, {|o,i| IF( i != nMax, o:minimize(), ) } ), aTabs[ nMax ]:maximize() }
|
||||
RETURN {|| aeval( aTabs, {|o,i| iif( i != nMax, o:minimize(), ) } ), aTabs[ nMax ]:maximize() }
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -1327,7 +1327,7 @@ FUNCTION Build_FileDialog( oWnd, cMode )
|
||||
aFiles := oDlg:open( "c:\temp", , .t. )
|
||||
IF !empty( aFiles )
|
||||
aeval( aFiles, {|e| HB_SYMBOL_UNUSED( e ) } )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ELSE
|
||||
oDlg:title := "Save this Database"
|
||||
oDlg:fileFilters := { { "Database Files", "*.dbf" } }
|
||||
@@ -1520,12 +1520,12 @@ FUNCTION Build_Rtf( oWnd )
|
||||
oBtn := XbpPushButton():new( oWnd, , {10+(nW+nG)*2, nT-25}, {nW,nH} )
|
||||
oBtn:caption := 'Font++'
|
||||
oBtn:create()
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, IF( x == 0, x := 11, ), oRTF:selFontSize := x+1 }
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, iif( x == 0, x := 11, ), oRTF:selFontSize := x+1 }
|
||||
|
||||
oBtn := XbpPushButton():new( oWnd, , {10+(nW+nG)*3, nT-25}, {nW,nH} )
|
||||
oBtn:caption := 'Font--'
|
||||
oBtn:create()
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, IF( x == 0, x := 11, ), oRTF:selFontSize := x-1 }
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, iif( x == 0, x := 11, ), oRTF:selFontSize := x-1 }
|
||||
|
||||
oBtn := XbpPushButton():new( oWnd, , {10+(nW+nG)*4, nT-25}, {nW,nH} )
|
||||
oBtn:caption := 'Print'
|
||||
@@ -1668,7 +1668,7 @@ STATIC FUNCTION RtfApplyFont( oRTF )
|
||||
FUNCTION Build_Browse_Y( oWnd )
|
||||
LOCAL cPath := hb_DirBase() + ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "tests" + hb_ps()
|
||||
LOCAL oXbpBrowse, aStruct, a_, oXbpColumn , aPresParam
|
||||
|
||||
|
||||
USE ( cPath + "test.dbf" ) NEW SHARED READONLY VIA 'DBFCDX'
|
||||
dbGotop()
|
||||
aStruct := DbStruct()
|
||||
@@ -1689,7 +1689,7 @@ FUNCTION Build_Browse_Y( oWnd )
|
||||
oXbpBrowse:posBlock := {| | RecNo() }
|
||||
oXbpBrowse:goPosBlock := {|n| DbGoto( n ) }
|
||||
oXbpBrowse:phyPosBlock := {| | RecNo() }
|
||||
|
||||
|
||||
FOR EACH a_ IN aStruct
|
||||
aPresParam := getPP( a_ )
|
||||
|
||||
@@ -1699,11 +1699,11 @@ FUNCTION Build_Browse_Y( oWnd )
|
||||
|
||||
oXbpBrowse:addColumn( oXbpColumn )
|
||||
NEXT
|
||||
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
FUNCTION dataLink( nField )
|
||||
RETURN {|| fieldget( nField ) }
|
||||
|
||||
@@ -1804,7 +1804,7 @@ FUNCTION Build_Browse( oWnd )
|
||||
aadd( aPresParam, { XBP_PP_COL_FA_FGCLR , GRA_CLR_BLACK } )
|
||||
aadd( aPresParam, { XBP_PP_COL_FA_BGCLR , GRA_CLR_DARKGRAY } )
|
||||
aadd( aPresParam, { XBP_PP_COL_FA_HEIGHT , 25 } )
|
||||
//
|
||||
//
|
||||
oXbpColumn := XbpColumn():new()
|
||||
oXbpColumn:dataLink := {|| test->Last }
|
||||
oXbpColumn:colorBlock := {|x| iif( left( x,1 ) $ "L,H", { GRA_CLR_BLUE, GRA_CLR_YELLOW }, { NIL, NIL } ) }
|
||||
@@ -1857,7 +1857,7 @@ FUNCTION Build_Browse( oWnd )
|
||||
oXbpColumn := XbpColumn():new()
|
||||
oXbpColumn:dataLink := {|| test->Salary }
|
||||
oXbpColumn:create( , , , , aPresParam )
|
||||
oXbpColumn:colorBlock := {|x| IF( x < 40000, { NIL, RGB( 255,0,0 ) }, {NIL,NIL} ) }
|
||||
oXbpColumn:colorBlock := {|x| iif( x < 40000, { NIL, RGB( 255,0,0 ) }, {NIL,NIL} ) }
|
||||
//
|
||||
oXbpBrowse:addColumn( oXbpColumn )
|
||||
|
||||
@@ -2065,4 +2065,3 @@ STATIC FUNCTION Build_ConfirmBox( oWnd )
|
||||
str( ConfirmBox( oWnd, "What do you want ?", "Confirm Status", XBPMB_YESNOCANCEL, XBPMB_WARNING, 2 ) ) )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ STATIC FUNCTION uiXtoS( xVar )
|
||||
CASE cType == "D"
|
||||
RETURN dtoc( xVar )
|
||||
CASE cType == "L"
|
||||
RETURN IF( xVar, "Yes", "No" )
|
||||
RETURN iif( xVar, "Yes", "No" )
|
||||
CASE cType == "M"
|
||||
RETURN xVar
|
||||
CASE cType == "C"
|
||||
@@ -245,7 +245,7 @@ STATIC FUNCTION PP_Debug( oXbp )
|
||||
LOCAL s := ''
|
||||
|
||||
aeval( aPP, {|e_| s += ( hb_ntos( e_[ 1 ] ) +' '+ valtype( e_[ 2 ] ) +' '+ ;
|
||||
IF( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ CRLF ) } )
|
||||
iif( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ CRLF ) } )
|
||||
|
||||
MsgBox( s )
|
||||
|
||||
@@ -307,7 +307,7 @@ STATIC FUNCTION Build_MenuBar( oDlg )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
//
|
||||
oSubMenu:insItem( 2, { "This executes MsgBox()" , {|| MyFunctionXbp( 103 ) }, , XBPMENUBAR_MIA_CHECKED } )
|
||||
oSubMenu:itemMarked := {|mp1| IF( mp1 == 5, MsgBox( "WOW - ::itemMarked - Activated" ), NIL ) }
|
||||
oSubMenu:itemMarked := {|mp1| iif( mp1 == 5, MsgBox( "WOW - ::itemMarked - Activated" ), NIL ) }
|
||||
|
||||
/* Menu colors are being honored in Harbour only */
|
||||
oSubMenu:setColorBG( GraMakeRGBColor( { 134,128,250 } ) )
|
||||
@@ -609,7 +609,7 @@ FUNCTION Build_RadioButton( oStatic )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
STATIC FUNCTION SetMaximized( aTabs, nMax )
|
||||
RETURN {|| aeval( aTabs, {|o,i| IF( i != nMax, o:minimize(), ) } ), aTabs[ nMax ]:maximize() }
|
||||
RETURN {|| aeval( aTabs, {|o,i| iif( i != nMax, o:minimize(), ) } ), aTabs[ nMax ]:maximize() }
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -1412,12 +1412,12 @@ STATIC FUNCTION Build_Rtf( oWnd )
|
||||
oBtn := XbpPushButton():new( oWnd, , {10+(nW+nG)*2, nT-25}, {nW,nH} )
|
||||
oBtn:caption := 'Font++'
|
||||
oBtn:create()
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, IF( x == 0, x := 11, ), oRTF:selFontSize := x+1 }
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, iif( x == 0, x := 11, ), oRTF:selFontSize := x+1 }
|
||||
|
||||
oBtn := XbpPushButton():new( oWnd, , {10+(nW+nG)*3, nT-25}, {nW,nH} )
|
||||
oBtn:caption := 'Font--'
|
||||
oBtn:create()
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, IF( x == 0, x := 11, ), oRTF:selFontSize := x-1 }
|
||||
oBtn:activate := {|x| x := oRTF:selFontSize, iif( x == 0, x := 11, ), oRTF:selFontSize := x-1 }
|
||||
|
||||
oBtn := XbpPushButton():new( oWnd, , {10+(nW+nG)*4, nT-25}, {nW,nH} )
|
||||
oBtn:caption := 'Print'
|
||||
@@ -1616,7 +1616,7 @@ STATIC FUNCTION Build_Browse( oWnd )
|
||||
oXbpColumn := XbpColumn():new()
|
||||
oXbpColumn:type := XBPCOL_TYPE_FILEICON
|
||||
cPath := hb_DirBase() + hb_ps()
|
||||
oXbpColumn:dataLink := {|n| n := recno(), IF( n%3 == 0, cPath + "abs3.png", IF( n%5 == 0, cPath + "copy.png", cPath + "vr.png" ) ) }
|
||||
oXbpColumn:dataLink := {|n| n := recno(), iif( n%3 == 0, cPath + "abs3.png", iif( n%5 == 0, cPath + "copy.png", cPath + "vr.png" ) ) }
|
||||
oXbpColumn:create( , , , , aPresParam )
|
||||
//
|
||||
oXbpBrowse:addColumn( oXbpColumn )
|
||||
@@ -1641,7 +1641,7 @@ STATIC FUNCTION Build_Browse( oWnd )
|
||||
|
||||
oXbpColumn := XbpColumn():new()
|
||||
oXbpColumn:dataLink := {|| test->Last }
|
||||
oXbpColumn:colorBlock := {|x| IF( left( x,1 ) $ "L,H", { GRA_CLR_BLUE, GRA_CLR_YELLOW }, { NIL, NIL } ) }
|
||||
oXbpColumn:colorBlock := {|x| iif( left( x,1 ) $ "L,H", { GRA_CLR_BLUE, GRA_CLR_YELLOW }, { NIL, NIL } ) }
|
||||
oXbpColumn:create( , , , , aPresParam )
|
||||
//
|
||||
oXbpBrowse:addColumn( oXbpColumn )
|
||||
@@ -1691,7 +1691,7 @@ STATIC FUNCTION Build_Browse( oWnd )
|
||||
oXbpColumn := XbpColumn():new()
|
||||
oXbpColumn:dataLink := {|| test->Salary }
|
||||
oXbpColumn:create( , , , , aPresParam )
|
||||
oXbpColumn:colorBlock := {|x| IF( x < 40000, { NIL, RGB( 255,0,0 ) }, {NIL,NIL} ) }
|
||||
oXbpColumn:colorBlock := {|x| iif( x < 40000, { NIL, RGB( 255,0,0 ) }, {NIL,NIL} ) }
|
||||
//
|
||||
oXbpBrowse:addColumn( oXbpColumn )
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ STATIC FUNCTION Build_MenuBar( oDlg )
|
||||
oMenuBar:addItem( { oSubMenu, NIL } )
|
||||
//
|
||||
oSubMenu:insItem( 2, { "This executes MsgBox()" , {|| MyFunctionXbp( 103 ) }, , XBPMENUBAR_MIA_CHECKED } )
|
||||
oSubMenu:itemMarked := {|mp1| IF( mp1 == 5, MsgBox( "WOW - ::itemMarked - Activated" ), NIL ) }
|
||||
oSubMenu:itemMarked := {|mp1| iif( mp1 == 5, MsgBox( "WOW - ::itemMarked - Activated" ), NIL ) }
|
||||
|
||||
/* Menu colors are being honored in Harbour only */
|
||||
oSubMenu:setColorBG( GraMakeRGBColor( { 134,128,250 } ) )
|
||||
@@ -545,7 +545,7 @@ STATIC FUNCTION uiXtoS( xVar )
|
||||
CASE cType == "D"
|
||||
RETURN dtoc( xVar )
|
||||
CASE cType == "L"
|
||||
RETURN IF( xVar, "Yes", "No" )
|
||||
RETURN iif( xVar, "Yes", "No" )
|
||||
CASE cType == "M"
|
||||
RETURN xVar
|
||||
CASE cType == "C"
|
||||
@@ -587,7 +587,7 @@ STATIC FUNCTION PP_Debug( oXbp )
|
||||
LOCAL s := ''
|
||||
|
||||
aeval( aPP, {|e_| s += ( hb_ntos( e_[ 1 ] ) +' '+ valtype( e_[ 2 ] ) +' '+ ;
|
||||
IF( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ CRLF ) } )
|
||||
iif( valtype( e_[ 2 ] )=='N', hb_ntos( e_[ 2 ] ), ' ' ) + '; '+ CRLF ) } )
|
||||
|
||||
MsgBox( s )
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ FUNCTION hbxbp_QKeyEventToAppEvent( oKeyEvent )
|
||||
c := xbeK_ ; EXIT
|
||||
#endif
|
||||
OTHERWISE
|
||||
IF( ( key >= 0 ) .and. ( key <= 255 ) )
|
||||
IF key >= 0 .and. key <= 255
|
||||
c := key
|
||||
ENDIF
|
||||
EXIT
|
||||
@@ -1062,4 +1062,3 @@ FUNCTION hbxbp_appEventModifier( key )
|
||||
ENDSWITCH
|
||||
|
||||
RETURN Qt_NoModifier
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ CLASS XbpTreeView INHERIT XbpWindow, DataRef
|
||||
METHOD setColorBG( nRGB ) INLINE WVG_TreeView_SetBkColor( ::hWnd, nRGB )
|
||||
METHOD setColorLines( nRGB ) INLINE WVG_TreeView_SetLineColor( ::hWnd, nRGB )
|
||||
METHOD showExpanded( lExpanded, nLevels ) INLINE Wvg_TreeView_ShowExpanded( ::hWnd, ;
|
||||
IF( HB_ISNIL( lExpanded ), .f., lExpanded ), nLevels )
|
||||
iif( HB_ISNIL( lExpanded ), .f., lExpanded ), nLevels )
|
||||
#endif
|
||||
ENDCLASS
|
||||
|
||||
|
||||
@@ -94,13 +94,13 @@ CLASS TJsWindow
|
||||
|
||||
METHOD Paragraph() INLINE ::QOut( "<P></P>" )
|
||||
|
||||
METHOD CENTER( l ) INLINE ::QOut( If( l, "<CENTER>", "</CENTER>" ) )
|
||||
METHOD CENTER( l ) INLINE ::QOut( iif( l, "<CENTER>", "</CENTER>" ) )
|
||||
|
||||
METHOD bold( l ) INLINE ::QOut( If( l, "<B>", "</B>" ) )
|
||||
METHOD bold( l ) INLINE ::QOut( iif( l, "<B>", "</B>" ) )
|
||||
|
||||
METHOD Italic( l ) INLINE ::QOut( If( l, "<I>", "</I>" ) )
|
||||
METHOD Italic( l ) INLINE ::QOut( iif( l, "<I>", "</I>" ) )
|
||||
|
||||
METHOD ULine( l ) INLINE ::QOut( If( l, "<U>", "</U>" ) )
|
||||
METHOD ULine( l ) INLINE ::QOut( iif( l, "<U>", "</U>" ) )
|
||||
|
||||
METHOD Put()
|
||||
|
||||
@@ -245,7 +245,7 @@ METHOD SetFeatures( alwaysRaised, alwaysLowered, ;
|
||||
cStr += "copyHistory=no,"
|
||||
ENDIF
|
||||
|
||||
::features += IF( Empty( ::Features ), cStr + ",", cStr )
|
||||
::features += iif( Empty( ::Features ), cStr + ",", cStr )
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -274,7 +274,7 @@ METHOD SetSize( x, y, h, w ) CLASS TJsWindow
|
||||
cStr += "height=" + hb_ntos( ::height ) + ","
|
||||
cStr += "width=" + hb_ntos( ::width )
|
||||
|
||||
::features += IF( Empty( ::Features ), cStr + ",", cStr )
|
||||
::features += iif( Empty( ::Features ), cStr + ",", cStr )
|
||||
|
||||
RETURN Self
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ STATIC FUNC ErrorMessage( e )
|
||||
LOCAL cMessage := ""
|
||||
|
||||
// start error message
|
||||
cMessage += IF( e:severity > ES_WARNING, "Error ", "Warning " )
|
||||
cMessage += iif( e:severity > ES_WARNING, "Error ", "Warning " )
|
||||
|
||||
// add subsystem name if available
|
||||
IF HB_ISSTRING( e:subsystem )
|
||||
|
||||
@@ -134,7 +134,7 @@ METHOD New( name, lOpen, width, height, bgColor, ;
|
||||
|
||||
cStr += "" //SPACE(10)
|
||||
cStr += name + " = new List("
|
||||
cStr += IF( lOpen, "true,", "false," )
|
||||
cStr += iif( lOpen, "true,", "false," )
|
||||
cStr += hb_ntos( width ) + ","
|
||||
cStr += hb_ntos( height ) + ","
|
||||
cStr += '"' + BGCOLOR + '"' + ");" + CRLF()
|
||||
@@ -161,7 +161,7 @@ METHOD NewNode( name, lOpen, width, height, bgColor ) CLASS TJsList
|
||||
DEFAULT BGCOLOR TO "white"
|
||||
cStr += "" //SPACE(10)
|
||||
cStr += name + "= new List("
|
||||
cStr += IF( lOpen, "true,", "false," )
|
||||
cStr += iif( lOpen, "true,", "false," )
|
||||
cStr += hb_ntos( width ) + ","
|
||||
cStr += hb_ntos( height ) + ","
|
||||
cStr += '"' + BGCOLOR + '"' + ");" + CRLF()
|
||||
@@ -230,7 +230,7 @@ METHOD AddLink( name, url, img, bgColor ) CLASS TJsList
|
||||
DEFAULT url TO ""
|
||||
DEFAULT img TO "webpage.jpg"
|
||||
cUrl := "<A HREF='" + url + "'><IMG SRC='" + img + "' border=0 align=absmiddle>" + htmlSpace( 2 ) + name + htmlSpace( 2 )
|
||||
cStr += ::cCurrentNode + '.addItem( "' + curl + '"' + IF( bgColor != NIL, ',"' + bgColor + '"', "" ) + ');' + CRLF()
|
||||
cStr += ::cCurrentNode + '.addItem( "' + curl + '"' + iif( bgColor != NIL, ',"' + bgColor + '"', "" ) + ');' + CRLF()
|
||||
::nItems ++
|
||||
Aadd( ::aScript, cStr )
|
||||
RETURN self
|
||||
|
||||
@@ -200,7 +200,7 @@ oHtm:endTable()
|
||||
|
||||
// --> put the formatted fields data...
|
||||
FOR i := 1 TO Len( aFlds )
|
||||
cAlign := IF( aFlds[ i, 2 ] == "N", "RIGHT", "CENTER" )
|
||||
cAlign := iif( aFlds[ i, 2 ] == "N", "RIGHT", "CENTER" )
|
||||
oHtm:newTableCell( cAlign,,,, "black" )
|
||||
oHtm:Write( greek2Html( htmlany2Str( Fieldget( i ) ) ) )
|
||||
oHtm:EndTableCell()
|
||||
@@ -274,7 +274,7 @@ oHtm:endTable()
|
||||
|
||||
FOR i := 1 TO oquery:fcount()
|
||||
|
||||
cAlign := IF( oCurRow:FieldType( i ) == "N", "RIGHT", "CENTER" )
|
||||
cAlign := iif( oCurRow:FieldType( i ) == "N", "RIGHT", "CENTER" )
|
||||
oHtm:newTableCell( cAlign,,,, "black" )
|
||||
oHtm:Write( greek2Html( htmlany2Str( oCurRow:FieldGet( i ) ) ) )
|
||||
oHtm:EndTableCell()
|
||||
@@ -338,13 +338,13 @@ Class JWindow
|
||||
|
||||
METHOD Paragraph() INLINE ::QOut( "<P></P>" )
|
||||
|
||||
METHOD CENTER( l ) INLINE ::QOut( If( l, "<CENTER>", "</CENTER>" ) )
|
||||
METHOD CENTER( l ) INLINE ::QOut( iif( l, "<CENTER>", "</CENTER>" ) )
|
||||
|
||||
METHOD bold( l ) INLINE ::QOut( If( l, "<B>", "</B>" ) )
|
||||
METHOD bold( l ) INLINE ::QOut( iif( l, "<B>", "</B>" ) )
|
||||
|
||||
METHOD Italic( l ) INLINE ::QOut( If( l, "<I>", "</I>" ) )
|
||||
METHOD Italic( l ) INLINE ::QOut( iif( l, "<I>", "</I>" ) )
|
||||
|
||||
METHOD ULine( l ) INLINE ::QOut( If( l, "<U>", "</U>" ) )
|
||||
METHOD ULine( l ) INLINE ::QOut( iif( l, "<U>", "</U>" ) )
|
||||
|
||||
METHOD Put()
|
||||
|
||||
@@ -495,7 +495,7 @@ METHOD SetFeatures( alwaysRaised, alwaysLowered, ;
|
||||
cStr += "copyHistory=no,"
|
||||
ENDIF
|
||||
|
||||
::features += IF( Empty( ::Features ), cStr + ",", cStr )
|
||||
::features += iif( Empty( ::Features ), cStr + ",", cStr )
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -526,7 +526,7 @@ METHOD SetSize( x, y, h, w ) Class JWindow
|
||||
cStr += "height=" + hb_ntos( ::height ) + ","
|
||||
cStr += "width=" + hb_ntos( ::width )
|
||||
|
||||
::features += IF( Empty( ::Features ), cStr + ",", cStr )
|
||||
::features += iif( Empty( ::Features ), cStr + ",", cStr )
|
||||
|
||||
RETURN Self
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ CLASS HBTable
|
||||
METHOD goTop() INLINE ( ::Alias )->( DBGOTOP() )
|
||||
METHOD goBottom() INLINE ( ::Alias )->( DBGOBOTTOM() )
|
||||
METHOD SetFocus() INLINE ( ::Alias )->( SELECT( ::ALias ) )
|
||||
METHOD Append( l ) INLINE IF( ::isNet, ( ::Alias )->( NetAppend( l ) ), ;
|
||||
METHOD Append( l ) INLINE iif( ::isNet, ( ::Alias )->( NetAppend( l ) ), ;
|
||||
( ::alias )->( DBAPPEND() ) )
|
||||
METHOD RECALL( ) INLINE ( ::Alias )->( NetRecall( ) )
|
||||
|
||||
@@ -758,7 +758,7 @@ CLASS HBTable
|
||||
|
||||
METHOD DBFILTER() INLINE ( ::Alias )->( DBFILTER() )
|
||||
METHOD SetFilter( c ) INLINE ;
|
||||
IF( c != NIL, ( ::Alias )->( DBSETFILTER( hb_macroBlock( c ), c ) ), ;
|
||||
iif( c != NIL, ( ::Alias )->( DBSETFILTER( hb_macroBlock( c ), c ) ), ;
|
||||
( ::Alias )->( DBCLEARFILTER() ) )
|
||||
|
||||
METHOD AddChild( oChild, cKey )
|
||||
@@ -1087,7 +1087,7 @@ METHOD __oTDelete( lKeepBuffer ) // ::Delete()
|
||||
::Read()
|
||||
|
||||
IF ::isNet
|
||||
lRet := IF( ( ::Alias )->( NetDelete() ), .T., .F. )
|
||||
lRet := iif( ( ::Alias )->( NetDelete() ), .T., .F. )
|
||||
ELSE
|
||||
( ::alias )->( DBDELETE() ) ; lRet := .T.
|
||||
ENDIF
|
||||
@@ -1428,7 +1428,7 @@ RETURN
|
||||
STATIC FUNCTION FixExt( cFileName )
|
||||
|
||||
LOCAL nLeft := AT( ".", cFilename )
|
||||
RETURN LEFT( cFileName, IF( nLeft == 0, ;
|
||||
RETURN LEFT( cFileName, iif( nLeft == 0, ;
|
||||
LEN( cFilename ), ;
|
||||
nLeft - 1 ) )
|
||||
|
||||
@@ -1467,7 +1467,7 @@ METHOD OnError( uParam ) CLASS HBTable
|
||||
nPos := (::Alias)->( FieldPos(cMsg) )
|
||||
|
||||
if nPos != 0
|
||||
uRet := (::Alias)->( if(uParam == nil, FieldGet(nPos), FieldPut(nPos, uParam)) )
|
||||
uRet := (::Alias)->( iif( uParam == nil, FieldGet(nPos), FieldPut(nPos, uParam)) )
|
||||
else
|
||||
|
||||
oErr := ErrorNew()
|
||||
|
||||
@@ -250,7 +250,7 @@ STATIC FUNCTION ErrorMessage( oError )
|
||||
LOCAL cMessage
|
||||
|
||||
// start error message
|
||||
cMessage := Iif( oError:severity > ES_WARNING, "Error", "Warning" ) + " "
|
||||
cMessage := iif( oError:severity > ES_WARNING, "Error", "Warning" ) + " "
|
||||
|
||||
// add subsystem name if available
|
||||
If HB_ISSTRING( oError:subsystem )
|
||||
@@ -355,7 +355,7 @@ STATIC FUNCTION LogError( oerr )
|
||||
FWriteLine( nHandle, "xHarbour built on..: " + hb_builddate() )
|
||||
FWriteLine( nHandle, "C/C++ compiler.....: " + hb_compiler() )
|
||||
|
||||
FWriteLine( nHandle, "Multi Threading....: " + If( hb_mtvm(),"YES","NO" ) )
|
||||
FWriteLine( nHandle, "Multi Threading....: " + iif( hb_mtvm(),"YES","NO" ) )
|
||||
FWriteLine( nHandle, "VM Optimization....: " + strvalue( Hb_VmMode() ) )
|
||||
|
||||
IF hb_IsFunction( "Select" )
|
||||
@@ -577,11 +577,11 @@ STATIC FUNCTION LogError( oerr )
|
||||
* cVarName := Left( nMemWidth, At( Chr( 0 ), nMemWidth ) - 1 )
|
||||
* cVarType := Substr( nMemWidth, 12, 1 )
|
||||
* cVarRec := Bin2w( Right( nMemWidth, 2 ) )
|
||||
* nMemCount := If( cVarType IN Chr( 195 ) + Chr( 204 ), 14 + cVarRec, 22 )
|
||||
* nMemCount := iif( cVarType IN Chr( 195 ) + Chr( 204 ), 14 + cVarRec, 22 )
|
||||
* Fseek( nMemHandle, nMemCount, 1 )
|
||||
* cTemp := Left( cVarName + Space( 10 ), 10 )
|
||||
* cTemp += " TYPE " + Type( cVarName )
|
||||
* cTemp += " " + If( Type( cVarName ) == "C", '"' + &cVarName + '"', strvalue( &cVarName ) )
|
||||
* cTemp += " " + iif( Type( cVarName ) == "C", '"' + &cVarName + '"', strvalue( &cVarName ) )
|
||||
* nBytes := 0
|
||||
* Switch ValType( cVarName )
|
||||
* Case "C"
|
||||
|
||||
@@ -46,7 +46,7 @@ MEMVAR __nCBid__,__temp__
|
||||
NIL,NIL,s_nCB_Kbd,NIL); ;
|
||||
AADD(s_aComboList, {__nCBid__, <"var"> }); ;
|
||||
__temp__ := wvw_cbFindString(NIL, __nCBid__, <var> ); ;
|
||||
if(__temp__>=0, wvw_cbSetIndex(NIL, __nCBid__, __temp__),NIL); ;
|
||||
iif(__temp__>=0, wvw_cbSetIndex(NIL, __nCBid__, __temp__),NIL); ;
|
||||
setpos(<row>,<col>); ;
|
||||
AAdd(GetList,_GET_(<var>,<"var">,repl("X",<nWidth>),,) ) ; ;
|
||||
ATAIL(GetList):cargo := __nCBid__; ;
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
//+
|
||||
// 99.05.31 initial posting.
|
||||
//-
|
||||
|
||||
#define CGI_SERVER_SOFTWARE 01
|
||||
#define CGI_SERVER_NAME 02
|
||||
#define CGI_GATEWAY_INTERFACE 03
|
||||
#define CGI_SERVER_PROTOCOL 04
|
||||
#define CGI_SERVER_PORT 05
|
||||
#define CGI_REQUEST_METHOD 06
|
||||
#define CGI_HTTP_ACCEPT 07
|
||||
#define CGI_HTTP_USER_AGENT 08
|
||||
#define CGI_HTTP_REFERER 09
|
||||
#define CGI_SERVER_SOFTWARE 1
|
||||
#define CGI_SERVER_NAME 2
|
||||
#define CGI_GATEWAY_INTERFACE 3
|
||||
#define CGI_SERVER_PROTOCOL 4
|
||||
#define CGI_SERVER_PORT 5
|
||||
#define CGI_REQUEST_METHOD 6
|
||||
#define CGI_HTTP_ACCEPT 7
|
||||
#define CGI_HTTP_USER_AGENT 8
|
||||
#define CGI_HTTP_REFERER 9
|
||||
#define CGI_PATH_INFO 10
|
||||
#define CGI_PATH_TRANSLATED 11
|
||||
#define CGI_SCRIPT_NAME 12
|
||||
|
||||
@@ -70,22 +70,22 @@ FUNCTION Main()
|
||||
// Reads all "Header" fields from CGI
|
||||
FOR i := 1 TO oIni:ReadNumber( "Header", "DataFields", 0 )
|
||||
|
||||
cField := oIni:ReadString( "Header", "DataField"+ltrim(str(i)), "" )
|
||||
oIni:WriteString( "Entries", cField + ltrim(str(nEntry)), ;
|
||||
strtran( strtran( oHTML:QueryFields( cField ), chr(10), "" ), chr(13), "<BR>" ) )
|
||||
cField := oIni:ReadString( "Header", "DataField" + hb_ntos( i ), "" )
|
||||
oIni:WriteString( "Entries", cField + hb_ntos( nEntry ), ;
|
||||
StrTran( StrTran( oHTML:QueryFields( cField ), Chr( 10 ), "" ), Chr( 13 ), "<br />" ) )
|
||||
|
||||
NEXT
|
||||
|
||||
// Write fields to .ini file
|
||||
oIni:WriteString( "Entries", "DateTime" + ltrim(str(nEntry)), ;
|
||||
cmonth( date() ) + " " + ltrim(str(day(date()))) + ", " + ;
|
||||
ltrim(str(year(date()))) + " " + time() )
|
||||
oIni:WriteString( "Entries", "DateTime" + hb_ntos( nEntry ), ;
|
||||
CMonth( Date() ) + " " + hb_ntos( Day( Date() ) ) + ", " + ;
|
||||
hb_ntos( Year( Date() ) ) + " " + Time() )
|
||||
|
||||
oIni:UpdateFile()
|
||||
|
||||
oHTML:cContent := '<HTML><HEAD><META HTTP-EQUIV="Refresh" ' + ;
|
||||
'CONTENT="0;URL=/cgi-bin/guestbk.exe"></HEAD>' + ;
|
||||
'<BODY></BODY></HTML>'
|
||||
oHTML:cContent := '<html><head><meta http-equiv="Refresh" ' + ;
|
||||
'content="0;url=/cgi-bin/guestbk.exe"></HEAD>' + ;
|
||||
'<body></body></html>'
|
||||
|
||||
oHTML:ShowResult()
|
||||
|
||||
@@ -111,13 +111,13 @@ FUNCTION Main()
|
||||
|
||||
FOR j := 1 TO oIni:ReadNumber( "Header", "DataFields", 0 )
|
||||
|
||||
cField := oIni:ReadString( "Header", "DataField" + ltrim( str(j) ), "" )
|
||||
aadd( aLine, { cField, ;
|
||||
oIni:ReadString( "Entries", cField + ltrim( str(i) ), "" ) } )
|
||||
cField := oIni:ReadString( "Header", "DataField" + hb_ntos( j ), "" )
|
||||
AAdd( aLine, { cField, ;
|
||||
oIni:ReadString( "Entries", cField + hb_ntos( i ), "" ) } )
|
||||
|
||||
NEXT
|
||||
|
||||
aadd( aEntries, aLine )
|
||||
AAdd( aEntries, aLine )
|
||||
|
||||
i--
|
||||
|
||||
@@ -126,29 +126,29 @@ FUNCTION Main()
|
||||
cCode := ""
|
||||
|
||||
// Formats each line according to the INI file
|
||||
FOR i := 1 TO len( aEntries )
|
||||
FOR i := 1 TO Len( aEntries )
|
||||
|
||||
cCode += "<TABLE WIDTH=100% CELLSPACING=0>" + chr(13) + chr(10)
|
||||
cCode += "<table width=100% cellspacing=0>" + Chr( 13 ) + Chr( 10 )
|
||||
cColor := iif( Mod( i, 2 ) == 0, cEvenColor, cOddColor )
|
||||
|
||||
FOR j := 1 TO oIni:ReadNumber( "Format", "FormatLines", 0 )
|
||||
|
||||
cCode += "<TR><TD BGCOLOR='" + cColor +"'>"
|
||||
cCode += "<tr><td bgcolor='" + cColor + "'>"
|
||||
|
||||
cLine := oIni:ReadString( "Format", "Format" + ltrim(str(j)), "" )
|
||||
FOR l := 1 TO len( aEntries[i] )
|
||||
cLine := strtran( cLine, "<#" + aEntries[i,l,1] + ">", ;
|
||||
aEntries[i,l,2] )
|
||||
cLine := oIni:ReadString( "Format", "Format" + hb_ntos( j ), "" )
|
||||
FOR l := 1 TO Len( aEntries[ i ] )
|
||||
cLine := StrTran( cLine, "<#" + aEntries[ i, l, 1 ] + ">", ;
|
||||
aEntries[ i, l, 2 ] )
|
||||
NEXT
|
||||
|
||||
cLine := strtran( cLine, "<#DateTime>", ;
|
||||
oIni:ReadString( "Entries", "DateTime" + ltrim(str(len(aEntries)-i+1)), "" ) )
|
||||
cLine := StrTran( cLine, "<#DateTime>", ;
|
||||
oIni:ReadString( "Entries", "DateTime" + hb_ntos( Len(aEntries ) - i + 1 ), "" ) )
|
||||
|
||||
cCode += cLine + "</TD></TR>" + chr(13)+chr(10)
|
||||
cCode += cLine + "</td></tr>" + Chr( 13 ) + Chr( 10 )
|
||||
|
||||
NEXT
|
||||
|
||||
cCode += "</TABLE>" + chr(13)+chr(10)
|
||||
cCode += "</table>" + Chr( 13 ) + Chr( 10 )
|
||||
|
||||
NEXT
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
Harbour Guestbook
|
||||
Felipe Coury <fcoury@flexsys-ci.com>
|
||||
|
||||
@@ -17,8 +21,8 @@ The best thing about this guestbook is its highly
|
||||
configurable architecture. Please review guestbk.ini
|
||||
for configuration options and further explanation.
|
||||
|
||||
That's it !!!
|
||||
That's it!
|
||||
|
||||
PS: If you don't have a WebServer, I will be pleased to
|
||||
demonstrate it to you. Just contact me via ICQ, my
|
||||
UIN is #19504786. Thanks!!!
|
||||
UIN is #19504786. Thanks!
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
function TIniFile()
|
||||
static oClass
|
||||
FUNCTION TIniFile()
|
||||
|
||||
if oClass == nil
|
||||
STATIC oClass
|
||||
|
||||
IF oClass == nil
|
||||
oClass := HBClass():New( "TINIFILE" ) // starts a new class definition
|
||||
|
||||
oClass:AddData( "FileName" ) // define this class objects datas
|
||||
@@ -27,284 +28,307 @@ function TIniFile()
|
||||
oClass:AddMethod( "UpdateFile", @UpdateFile() )
|
||||
|
||||
oClass:Create() // builds this class
|
||||
endif
|
||||
return oClass:Instance() // builds an object of this class
|
||||
ENDIF
|
||||
|
||||
static function New(cFileName)
|
||||
local Self := QSelf()
|
||||
local Done, hFile, cFile, cLine, cIdent, nPos
|
||||
local CurrArray
|
||||
RETURN oClass:Instance() // builds an object of this class
|
||||
|
||||
if empty(cFileName)
|
||||
STATIC FUNCTION New( cFileName )
|
||||
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL Done, hFile, cFile, cLine, cIdent, nPos
|
||||
LOCAL CurrArray
|
||||
|
||||
IF Empty( cFileName )
|
||||
// raise an error?
|
||||
outerr("No filename passed to TIniFile():New()")
|
||||
return nil
|
||||
OutErr( "No filename passed to TIniFile():New()" )
|
||||
RETURN nil
|
||||
|
||||
else
|
||||
ELSE
|
||||
::FileName := cFilename
|
||||
::Contents := {}
|
||||
CurrArray := ::Contents
|
||||
|
||||
if File(cFileName)
|
||||
hFile := fopen(cFilename, 0)
|
||||
|
||||
else
|
||||
hFile := fcreate(cFilename)
|
||||
endif
|
||||
IF File( cFileName )
|
||||
hFile := FOpen( cFilename, 0 )
|
||||
ELSE
|
||||
hFile := FCreate( cFilename )
|
||||
ENDIF
|
||||
|
||||
cLine := ""
|
||||
Done := .f.
|
||||
while !Done
|
||||
cFile := space(256)
|
||||
Done := (fread(hFile, @cFile, 256) <= 0)
|
||||
Done := .F.
|
||||
WHILE ! Done
|
||||
cFile := Space( 256 )
|
||||
Done := ( FRead( hFile, @cFile, 256 ) <= 0 )
|
||||
|
||||
cFile := strtran(cFile, chr(10), "") // so we can just search for CHR(13)
|
||||
cFile := StrTran( cFile, Chr( 10 ), "" ) // so we can just search for CHR(13)
|
||||
|
||||
// prepend last read
|
||||
cFile := cLine + cFile
|
||||
while !empty(cFile)
|
||||
if (nPos := at(chr(13), cFile)) > 0
|
||||
cLine := left(cFile, nPos - 1)
|
||||
cFile := substr(cFile, nPos + 1)
|
||||
WHILE ! Empty( cFile )
|
||||
IF ( nPos := At( Chr(13 ), cFile ) ) > 0
|
||||
cLine := Left( cFile, nPos - 1 )
|
||||
cFile := SubStr( cFile, nPos + 1 )
|
||||
|
||||
if !empty(cLine)
|
||||
if Left(cLine, 1) == "[" // new section
|
||||
if (nPos := At("]", cLine)) > 1
|
||||
cLine := substr(cLine, 2, nPos - 2);
|
||||
IF ! Empty( cLine )
|
||||
IF Left( cLine, 1 ) == "[" // new section
|
||||
IF ( nPos := At( "]", cLine ) ) > 1
|
||||
cLine := SubStr( cLine, 2, nPos - 2 )
|
||||
ELSE
|
||||
cLine := SubStr( cLine, 2 )
|
||||
ENDIF
|
||||
|
||||
else
|
||||
cLine := substr(cLine, 2)
|
||||
endif
|
||||
AAdd( ::Contents, { cLine, { /* this will be CurrArray */ } } )
|
||||
CurrArray := ::Contents[ Len( ::Contents ) ][ 2 ]
|
||||
|
||||
AAdd(::Contents, { cLine, { /* this will be CurrArray */ } } )
|
||||
CurrArray := ::Contents[Len(::Contents)][2]
|
||||
|
||||
elseif Left(cLine, 1) == ";" // preserve comments
|
||||
ELSEIF Left( cLine, 1 ) == ";" // preserve comments
|
||||
AAdd( CurrArray, { NIL, cLine } )
|
||||
|
||||
else
|
||||
if (nPos := At("=", cLine)) > 0
|
||||
cIdent := Left(cLine, nPos - 1)
|
||||
cLine := SubStr(cLine, nPos + 1)
|
||||
ELSE
|
||||
IF ( nPos := At( "=", cLine ) ) > 0
|
||||
cIdent := Left( cLine, nPos - 1 )
|
||||
cLine := SubStr( cLine, nPos + 1 )
|
||||
|
||||
AAdd( CurrArray, { cIdent, cLine } )
|
||||
|
||||
else
|
||||
ELSE
|
||||
AAdd( CurrArray, { cLine, "" } )
|
||||
endif
|
||||
endif
|
||||
ENDIF
|
||||
ENDIF
|
||||
cLine := "" // to stop prepend later on
|
||||
endif
|
||||
ENDIF
|
||||
|
||||
else
|
||||
ELSE
|
||||
cLine := cFile
|
||||
cFile := ""
|
||||
endif
|
||||
ENDIF
|
||||
end
|
||||
end
|
||||
|
||||
fclose(hFile)
|
||||
endif
|
||||
return Self
|
||||
FClose( hFile )
|
||||
ENDIF
|
||||
|
||||
static function ReadString(cSection, cIdent, cDefault)
|
||||
local Self := QSelf()
|
||||
local cResult := cDefault
|
||||
local i, j, cFind
|
||||
RETURN Self
|
||||
|
||||
if Empty(cSection)
|
||||
cFind := lower(cIdent)
|
||||
j := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cFind .and. HB_ISSTRING(x[2]) } )
|
||||
STATIC FUNCTION ReadString( cSection, cIdent, cDefault )
|
||||
|
||||
if j > 0
|
||||
cResult := ::Contents[j][2]
|
||||
endif
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL cResult := cDefault
|
||||
LOCAL i, j, cFind
|
||||
|
||||
else
|
||||
cFind := lower(cSection)
|
||||
i := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cFind} )
|
||||
IF Empty( cSection )
|
||||
cFind := Lower( cIdent )
|
||||
j := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind .AND. HB_ISSTRING( x[ 2 ] ) } )
|
||||
|
||||
if i > 0
|
||||
cFind := lower(cIdent)
|
||||
j := AScan( ::Contents[i][2], {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cFind} )
|
||||
IF j > 0
|
||||
cResult := ::Contents[ j ][ 2 ]
|
||||
ENDIF
|
||||
|
||||
if j > 0
|
||||
cResult := ::Contents[i][2][j][2]
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return cResult
|
||||
ELSE
|
||||
cFind := Lower( cSection )
|
||||
i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } )
|
||||
|
||||
static procedure WriteString(cSection, cIdent, cString)
|
||||
local Self := QSelf()
|
||||
local i, j, cFind
|
||||
IF i > 0
|
||||
cFind := Lower( cIdent )
|
||||
j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } )
|
||||
|
||||
if Empty(cIdent)
|
||||
outerr("Must specify an identifier")
|
||||
IF j > 0
|
||||
cResult := ::Contents[ i ][ 2 ][ j ][ 2 ]
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
elseif Empty(cSection)
|
||||
cFind := lower(cIdent)
|
||||
j := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cFind .and. HB_ISSTRING(x[2]) } )
|
||||
RETURN cResult
|
||||
|
||||
if j > 0
|
||||
::Contents[j][2] := cString
|
||||
STATIC PROCEDURE WriteString( cSection, cIdent, cString )
|
||||
|
||||
else
|
||||
AAdd(::Contents, nil)
|
||||
AIns(::Contents, 1)
|
||||
::Contents[1] := {cIdent, cString}
|
||||
endif
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL i, j, cFind
|
||||
|
||||
else
|
||||
cFind := lower(cSection)
|
||||
if (i := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cFind .and. HB_ISARRAY(x[2]) })) > 0
|
||||
cFind := lower(cIdent)
|
||||
j := AScan( ::Contents[i][2], {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cFind} )
|
||||
IF Empty( cIdent )
|
||||
OutErr( "Must specify an identifier" )
|
||||
|
||||
if j > 0
|
||||
::Contents[i][2][j][2] := cString
|
||||
ELSEIF Empty( cSection )
|
||||
cFind := Lower( cIdent )
|
||||
j := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind .AND. HB_ISSTRING( x[ 2 ] ) } )
|
||||
|
||||
else
|
||||
AAdd( ::Contents[i][2], {cIdent, cString} )
|
||||
endif
|
||||
IF j > 0
|
||||
::Contents[ j ][ 2 ] := cString
|
||||
ELSE
|
||||
AAdd( ::Contents, nil )
|
||||
AIns( ::Contents, 1 )
|
||||
::Contents[ 1 ] := { cIdent, cString }
|
||||
ENDIF
|
||||
|
||||
else
|
||||
AAdd( ::Contents, {cSection, {{cIdent, cString}}} )
|
||||
endif
|
||||
endif
|
||||
return
|
||||
ELSE
|
||||
cFind := Lower( cSection )
|
||||
IF ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. Lower(x[ 1 ] ) == cFind .AND. HB_ISARRAY(x[ 2 ] ) } ) ) > 0
|
||||
cFind := Lower( cIdent )
|
||||
j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } )
|
||||
|
||||
static function ReadNumber(cSection, cIdent, nDefault)
|
||||
local Self := QSelf()
|
||||
return Val( ::ReadString(cSection, cIdent, str(nDefault)) )
|
||||
IF j > 0
|
||||
::Contents[ i ][ 2 ][ j ][ 2 ] := cString
|
||||
ELSE
|
||||
AAdd( ::Contents[ i ][ 2 ], { cIdent, cString } )
|
||||
ENDIF
|
||||
|
||||
static procedure WriteNumber(cSection, cIdent, nNumber)
|
||||
local Self := QSelf()
|
||||
ELSE
|
||||
AAdd( ::Contents, { cSection, { {cIdent, cString} } } )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
::WriteString( cSection, cIdent, alltrim(str(nNumber)) )
|
||||
return
|
||||
RETURN
|
||||
|
||||
static function ReadDate(cSection, cIdent, dDefault)
|
||||
local Self := QSelf()
|
||||
return SToD( ::ReadString(cSection, cIdent, DToS(dDefault)) )
|
||||
STATIC FUNCTION ReadNumber( cSection, cIdent, nDefault )
|
||||
|
||||
static procedure WriteDate(cSection, cIdent, dDate)
|
||||
local Self := QSelf()
|
||||
LOCAL Self := QSelf()
|
||||
|
||||
::WriteString( cSection, cIdent, DToS(dDate) )
|
||||
return
|
||||
RETURN Val( ::ReadString( cSection, cIdent, Str(nDefault ) ) )
|
||||
|
||||
static function ReadBool(cSection, cIdent, lDefault)
|
||||
local Self := QSelf()
|
||||
local cDefault := Iif( lDefault, ".t.", ".f." )
|
||||
STATIC PROCEDURE WriteNumber( cSection, cIdent, nNumber )
|
||||
|
||||
return ::ReadString(cSection, cIdent, cDefault) == ".t."
|
||||
LOCAL Self := QSelf()
|
||||
|
||||
static procedure WriteBool(cSection, cIdent, lBool)
|
||||
local Self := QSelf()
|
||||
::WriteString( cSection, cIdent, hb_ntos( nNumber ) )
|
||||
|
||||
::WriteString( cSection, cIdent, Iif(lBool, ".t.", ".f.") )
|
||||
return
|
||||
RETURN
|
||||
|
||||
static procedure DeleteKey(cSection, cIdent)
|
||||
local Self := QSelf()
|
||||
local i, j
|
||||
STATIC FUNCTION ReadDate( cSection, cIdent, dDefault )
|
||||
|
||||
cSection := lower(cSection)
|
||||
i := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cSection} )
|
||||
LOCAL Self := QSelf()
|
||||
|
||||
if i > 0
|
||||
cIdent := lower(cIdent)
|
||||
j := AScan( ::Contents[i][2], {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cIdent} )
|
||||
RETURN SToD( ::ReadString( cSection, cIdent, DToS(dDefault ) ) )
|
||||
|
||||
ADel( ::Contents[i][2], j )
|
||||
ASize( ::Contents[i][2], Len(::Contents[i][2]) - 1 )
|
||||
endif
|
||||
return
|
||||
STATIC PROCEDURE WriteDate( cSection, cIdent, dDate )
|
||||
|
||||
static procedure EraseSection(cSection)
|
||||
local Self := QSelf()
|
||||
local i
|
||||
LOCAL Self := QSelf()
|
||||
|
||||
if Empty(cSection)
|
||||
while (i := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. HB_ISSTRING(x[2]) })) > 0
|
||||
::WriteString( cSection, cIdent, DToS( dDate ) )
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC FUNCTION ReadBool( cSection, cIdent, lDefault )
|
||||
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL cDefault := iif( lDefault, ".t.", ".f." )
|
||||
|
||||
RETURN ::ReadString( cSection, cIdent, cDefault ) == ".t."
|
||||
|
||||
STATIC PROCEDURE WriteBool( cSection, cIdent, lBool )
|
||||
|
||||
LOCAL Self := QSelf()
|
||||
|
||||
::WriteString( cSection, cIdent, iif( lBool, ".t.", ".f." ) )
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE DeleteKey( cSection, cIdent )
|
||||
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL i, j
|
||||
|
||||
cSection := Lower( cSection )
|
||||
i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cSection } )
|
||||
|
||||
IF i > 0
|
||||
cIdent := Lower( cIdent )
|
||||
j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cIdent } )
|
||||
|
||||
ADel( ::Contents[ i ][ 2 ], j )
|
||||
ASize( ::Contents[ i ][ 2 ], Len( ::Contents[ i ][ 2 ] ) - 1 )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE EraseSection( cSection )
|
||||
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL i
|
||||
|
||||
IF Empty( cSection )
|
||||
WHILE ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. HB_ISSTRING(x[ 2 ] ) } ) ) > 0
|
||||
ADel( ::Contents, i )
|
||||
ASize( ::Contents, len(::Contents) - 1 )
|
||||
ASize( ::Contents, Len( ::Contents ) - 1 )
|
||||
end
|
||||
|
||||
else
|
||||
cSection := lower(cSection)
|
||||
if (i := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. lower(x[1]) == cSection .and. HB_ISARRAY(x[2]) })) > 0
|
||||
ELSE
|
||||
cSection := Lower( cSection )
|
||||
IF ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. Lower(x[ 1 ] ) == cSection .AND. HB_ISARRAY(x[ 2 ] ) } ) ) > 0
|
||||
ADel( ::Contents, i )
|
||||
ASize( ::Contents, Len(::Contents) - 1 )
|
||||
endif
|
||||
endif
|
||||
return
|
||||
ASize( ::Contents, Len( ::Contents ) - 1 )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
static function ReadSection(cSection)
|
||||
local Self := QSelf()
|
||||
local i, j, aSection := {}
|
||||
RETURN
|
||||
|
||||
if Empty(cSection)
|
||||
for i := 1 to len(::Contents)
|
||||
if HB_ISSTRING(::Contents[i][1]) .and. HB_ISSTRING(::Contents[i][2])
|
||||
aadd(aSection, ::Contents[i][1])
|
||||
endif
|
||||
next
|
||||
STATIC FUNCTION ReadSection( cSection )
|
||||
|
||||
else
|
||||
cSection := lower(cSection)
|
||||
if (i := AScan( ::Contents, {|x| HB_ISSTRING(x[1]) .and. x[1] == cSection .and. HB_ISARRAY(x[2]) })) > 0
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL i, j, aSection := {}
|
||||
|
||||
for j := 1 to Len(::Contents[i][2])
|
||||
IF Empty( cSection )
|
||||
FOR i := 1 TO Len( ::Contents )
|
||||
IF HB_ISSTRING( ::Contents[ i ][ 1 ] ) .AND. HB_ISSTRING( ::Contents[ i ][ 2 ] )
|
||||
AAdd( aSection, ::Contents[ i ][ 1 ] )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
if ::Contents[i][2][j][1] != NIL
|
||||
AAdd(aSection, ::Contents[i][2][j][1])
|
||||
endif
|
||||
next
|
||||
endif
|
||||
endif
|
||||
return aSection
|
||||
ELSE
|
||||
cSection := Lower( cSection )
|
||||
IF ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. x[ 1 ] == cSection .AND. HB_ISARRAY(x[ 2 ] ) } ) ) > 0
|
||||
|
||||
static function ReadSections()
|
||||
local Self := QSelf()
|
||||
local i, aSections := {}
|
||||
FOR j := 1 TO Len( ::Contents[ i ][ 2 ] )
|
||||
|
||||
for i := 1 to Len(::Contents)
|
||||
IF ::Contents[ i ][ 2 ][ j ][ 1 ] != NIL
|
||||
AAdd( aSection, ::Contents[ i ][ 2 ][ j ][ 1 ] )
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
if HB_ISARRAY(::Contents[i][2])
|
||||
AAdd(aSections, ::Contents[i][1])
|
||||
endif
|
||||
next
|
||||
return aSections
|
||||
RETURN aSection
|
||||
|
||||
static procedure UpdateFile()
|
||||
local Self := QSelf()
|
||||
local i, j, hFile
|
||||
STATIC FUNCTION ReadSections()
|
||||
|
||||
hFile := fcreate(::Filename)
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL i, aSections := {}
|
||||
|
||||
for i := 1 to Len(::Contents)
|
||||
if ::Contents[i][1] == NIL
|
||||
fwrite(hFile, ::Contents[i][2] + Chr(13) + Chr(10))
|
||||
FOR i := 1 TO Len( ::Contents )
|
||||
|
||||
elseif HB_ISARRAY(::Contents[i][2])
|
||||
fwrite(hFile, "[" + ::Contents[i][1] + "]" + Chr(13) + Chr(10))
|
||||
for j := 1 to Len(::Contents[i][2])
|
||||
IF HB_ISARRAY( ::Contents[ i ][ 2 ] )
|
||||
AAdd( aSections, ::Contents[ i ][ 1 ] )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
if ::Contents[i][2][j][1] == NIL
|
||||
fwrite(hFile, ::Contents[i][2][j][2] + Chr(13) + Chr(10))
|
||||
RETURN aSections
|
||||
|
||||
else
|
||||
fwrite(hFile, ::Contents[i][2][j][1] + "=" + ::Contents[i][2][j][2] + Chr(13) + Chr(10))
|
||||
endif
|
||||
next
|
||||
fwrite(hFile, Chr(13) + Chr(10))
|
||||
STATIC PROCEDURE UpdateFile()
|
||||
|
||||
elseif HB_ISSTRING(::Contents[i][2])
|
||||
fwrite(hFile, ::Contents[i][1] + "=" + ::Contents[i][2] + Chr(13) + Chr(10))
|
||||
LOCAL Self := QSelf()
|
||||
LOCAL i, j, hFile
|
||||
|
||||
endif
|
||||
next
|
||||
fclose(hFile)
|
||||
return
|
||||
hFile := FCreate( ::Filename )
|
||||
|
||||
FOR i := 1 TO Len( ::Contents )
|
||||
if ::Contents[ i ][ 1 ] == NIL
|
||||
FWrite( hFile, ::Contents[ i ][ 2 ] + Chr( 13 ) + Chr( 10 ) )
|
||||
|
||||
ELSEIF HB_ISARRAY( ::Contents[ i ][ 2 ] )
|
||||
FWrite( hFile, "[" + ::Contents[ i ][ 1 ] + "]" + Chr( 13 ) + Chr( 10 ) )
|
||||
FOR j := 1 TO Len( ::Contents[ i ][ 2 ] )
|
||||
|
||||
if ::Contents[ i ][ 2 ][ j ][ 1 ] == NIL
|
||||
FWrite( hFile, ::Contents[ i ][ 2 ][ j ][ 2 ] + Chr( 13 ) + Chr( 10 ) )
|
||||
ELSE
|
||||
FWrite( hFile, ::Contents[ i ][ 2 ][ j ][ 1 ] + "=" + ::Contents[ i ][ 2 ][ j ][ 2 ] + Chr( 13 ) + Chr( 10 ) )
|
||||
ENDIF
|
||||
NEXT
|
||||
FWrite( hFile, Chr( 13 ) + Chr( 10 ) )
|
||||
|
||||
ELSEIF HB_ISSTRING( ::Contents[ i ][ 2 ] )
|
||||
FWrite( hFile, ::Contents[ i ][ 1 ] + "=" + ::Contents[ i ][ 2 ] + Chr( 13 ) + Chr( 10 ) )
|
||||
|
||||
ENDIF
|
||||
NEXT
|
||||
FClose( hFile )
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -25,4 +25,4 @@
|
||||
|
||||
FUNCTION sx_FieldBlock( cFieldName )
|
||||
|
||||
RETURN {| arg | if( arg == NIL, sx_GetValue( cFieldName ), sx_Replace( cFieldName, arg ) ) }
|
||||
RETURN {| arg | iif( arg == NIL, sx_GetValue( cFieldName ), sx_Replace( cFieldName, arg ) ) }
|
||||
|
||||
@@ -45,7 +45,7 @@ PROCEDURE MAIN()
|
||||
? 'sxApi way ...'
|
||||
?
|
||||
? "TEST" $ sx_GetValue( "MYCHAR" )
|
||||
? IF( sx_GetValue( "MYLOGIC" ), "TRUE", "FALSE" )
|
||||
? iif( sx_GetValue( "MYLOGIC" ), "TRUE", "FALSE" )
|
||||
? sx_GetValue( "MYNUMBER1" ) + sx_GetValue( "MYNUMBER2" )
|
||||
? sx_GetValue( "MYDATE" ) + 30
|
||||
?
|
||||
|
||||
@@ -203,7 +203,7 @@ METHOD ExcelWriterXML_Style:getStyleXML()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF( ::useFont )
|
||||
IF ::useFont
|
||||
IF ! empty( ::fontColor )
|
||||
fontColor := 'ss:Color="' + ::fontColor + '"'
|
||||
ENDIF
|
||||
|
||||
@@ -680,23 +680,23 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
|
||||
dEnd := DATE()
|
||||
ENDIF
|
||||
|
||||
IF( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
|
||||
IF( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
|
||||
iif( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
|
||||
iif( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
|
||||
|
||||
nTotalSec := (dEnd - dStart) * 86400 + ;
|
||||
VAL(cTimeEnd) * 3600 + ;
|
||||
VAL(SUBSTR(cTimeEnd,AT(':', cTimeEnd)+1,2)) * 60 + ;
|
||||
IF(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ;
|
||||
iif(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ;
|
||||
VAL(SUBSTR(cTimeEnd,RAT(':', cTimeEnd)+1))) - ;
|
||||
VAL(cTimeStart) * 3600 - ;
|
||||
VAL(SUBSTR(cTimeStart,AT(':', cTimeStart)+1,2)) * 60 - ;
|
||||
IF(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ;
|
||||
iif(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ;
|
||||
VAL(SUBSTR(cTimeStart,RAT(':', cTimeStart)+1)))
|
||||
|
||||
nTemp := nTotalSec
|
||||
|
||||
FOR nCtr := 1 to 4
|
||||
nConstant := IF(nCtr == 1, 86400, IF(nCtr == 2, 3600, IF( nCtr == 3, 60, 1)))
|
||||
nConstant := iif(nCtr == 1, 86400, iif(nCtr == 2, 3600, iif( nCtr == 3, 60, 1)))
|
||||
aRetVal[nCtr,1] := INT(nTemp/nConstant)
|
||||
aRetval[nCtr,2] := nTotalSec / nConstant
|
||||
nTemp -= aRetVal[nCtr,1] * nConstant
|
||||
|
||||
@@ -751,23 +751,23 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
|
||||
dEnd := DATE()
|
||||
ENDIF
|
||||
|
||||
IF( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
|
||||
IF( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
|
||||
iif( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
|
||||
iif( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
|
||||
|
||||
nTotalSec := (dEnd - dStart) * 86400 + ;
|
||||
VAL(cTimeEnd) * 3600 + ;
|
||||
VAL(SUBSTR(cTimeEnd,AT(':', cTimeEnd)+1,2)) * 60 + ;
|
||||
IF(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ;
|
||||
iif(RAT(':', cTimeEnd) == AT(':', cTimeEnd), 0, ;
|
||||
VAL(SUBSTR(cTimeEnd,RAT(':', cTimeEnd)+1))) - ;
|
||||
VAL(cTimeStart) * 3600 - ;
|
||||
VAL(SUBSTR(cTimeStart,AT(':', cTimeStart)+1,2)) * 60 - ;
|
||||
IF(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ;
|
||||
iif(RAT(':', cTimeStart) == AT(':', cTimeStart), 0, ;
|
||||
VAL(SUBSTR(cTimeStart,RAT(':', cTimeStart)+1)))
|
||||
|
||||
nTemp := nTotalSec
|
||||
|
||||
FOR nCtr := 1 to 4
|
||||
nConstant := IF(nCtr == 1, 86400, IF(nCtr == 2, 3600, IF( nCtr == 3, 60, 1)))
|
||||
nConstant := iif(nCtr == 1, 86400, iif(nCtr == 2, 3600, iif( nCtr == 3, 60, 1)))
|
||||
aRetVal[nCtr,1] := INT(nTemp/nConstant)
|
||||
aRetval[nCtr,2] := nTotalSec / nConstant
|
||||
nTemp -= aRetVal[nCtr,1] * nConstant
|
||||
|
||||
@@ -1813,7 +1813,7 @@ FUNCTION uhttpd_join( cSeparator, aData )
|
||||
ENDIF
|
||||
IF VALTYPE(aData[nI]) $ "CM"; cRet += aData[nI]
|
||||
ELSEIF VALTYPE(aData[nI]) == "N"; cRet += LTRIM(STR(aData[nI]))
|
||||
ELSEIF VALTYPE(aData[nI]) == "D"; cRet += IF(!EMPTY(aData[nI]), DTOC(aData[nI]), "")
|
||||
ELSEIF VALTYPE(aData[nI]) == "D"; cRet += iif(!EMPTY(aData[nI]), DTOC(aData[nI]), "")
|
||||
ELSE
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
Reference in New Issue
Block a user