2009-05-08 07:33 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* source/rtl/tclass.prg
  * source/rtl/treport.prg
  * source/rtl/tpersist.prg
    + Added support for TIMESTAMP types.

  * source/rtl/tclass.prg
    % Using SWITCH in AddData()/AddClassData().
This commit is contained in:
Viktor Szakats
2009-05-08 05:34:27 +00:00
parent 7f4b915d87
commit 117995844b
4 changed files with 46 additions and 20 deletions

View File

@@ -17,6 +17,15 @@
past entries belonging to these authors: Viktor Szakats.
*/
2009-05-08 07:33 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/tclass.prg
* source/rtl/treport.prg
* source/rtl/tpersist.prg
+ Added support for TIMESTAMP types.
* source/rtl/tclass.prg
% Using SWITCH in AddData()/AddClassData().
2009-05-08 01:36 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/xhb/stream.prg
! disabled call to HB_IsByRef(). Such function does not exist in Harbour
@@ -40,7 +49,7 @@
2009-05-07 19:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/tget.prg
! Fixed to check for ::cType != NIL before
each SWITCH ::cType statments. Thanks to Przemek
each SWITCH ::cType statements. Thanks to Przemek
for pointing it out.
* source/rtl/alert.prg

View File

@@ -71,8 +71,8 @@
*
*/
/* NOTE: This .prg is also used by the debugger subsystem,
therefore we need this switch to avoid an infinite
/* NOTE: This .prg is also used by the debugger subsystem,
therefore we need this switch to avoid an infinite
loop when launching it. [vszakats] */
#pragma DEBUGINFO=OFF
@@ -310,21 +310,26 @@ STATIC FUNCTION Instance()
STATIC PROCEDURE AddData( cData, xInit, cType, nScope, lNoinit )
LOCAL c
DEFAULT lNoInit TO .F.
DEFAULT nScope TO HB_OO_CLSTP_EXPORTED
/* Default Init for Logical and numeric */
IF ! lNoInit .AND. cType != NIL .AND. xInit == NIL
c := Upper( Left( cType, 1 ) )
IF c == "L" /* Logical */
SWITCH Upper( Left( cType, 1 ) )
CASE "L" /* Logical */
xInit := .F.
ELSEIF c $ "NI" /* Numeric or Integer */
EXIT
CASE "I" /* Numeric or Integer */
CASE "N" /* Numeric or Integer */
xInit := 0
ELSEIF c == "D" /* Date */
EXIT
CASE "D" /* Date */
xInit := hb_SToD()
ENDIF
EXIT
CASE "T" /* Timestamp */
xInit := hb_SToT( "" )
EXIT
ENDSWITCH
ENDIF
AAdd( QSelf():aDatas, { cData, xInit, cType, nScope } )
@@ -346,8 +351,6 @@ STATIC PROCEDURE AddMultiData( cType, xInit, nScope, aData, lNoInit )
STATIC PROCEDURE AddClassData( cData, xInit, cType, nScope, lNoInit )
LOCAL c
DEFAULT lNoInit TO .F.
DEFAULT nScope TO HB_OO_CLSTP_EXPORTED
@@ -355,14 +358,21 @@ STATIC PROCEDURE AddClassData( cData, xInit, cType, nScope, lNoInit )
/* Default Init for Logical and numeric */
IF ! lNoInit .AND. cType != NIL .AND. xInit == NIL
c := Upper( Left( cType, 1 ) )
IF c == "L" /* Logical */
SWITCH Upper( Left( cType, 1 ) )
CASE "L" /* Logical */
xInit := .F.
ELSEIF c $ "NI" /* Numeric or Integer */
EXIT
CASE "I" /* Numeric or Integer */
CASE "N" /* Numeric or Integer */
xInit := 0
ELSEIF c == "D" /* Date */
EXIT
CASE "D" /* Date */
xInit := hb_SToD()
ENDIF
EXIT
CASE "T" /* Timestamp */
xInit := hb_SToT( "" )
EXIT
ENDSWITCH
ENDIF
AAdd( QSelf():aClsDatas, { cData, xInit, cType, nScope } )

View File

@@ -228,6 +228,9 @@ STATIC FUNCTION ValToText( uValue )
cText := DToS( uValue )
cText := "0d" + iif( Empty( cText ), "00000000", cText )
CASE cType == "T"
cText := 't"' + hb_TSToStr( uValue, .T. ) + '"'
OTHERWISE
cText := hb_ValToStr( uValue )
ENDCASE

View File

@@ -209,7 +209,7 @@ METHOD New( cFrmName, lPrinter, cAltFile, lNoConsole, bFor, bWhile, nNext, nReco
err:subSystem := "FRMLBL"
Eval( ErrorBlock(), err )
ELSE
/* NOTE: CA-Cl*pper does an RTrim() on the filename here,
/* NOTE: CA-Cl*pper does an RTrim() on the filename here,
but in Harbour we're using _SET_TRIMFILENAME. */
IF Set( _SET_DEFEXTENSIONS )
hb_FNameSplit( cFRMName, NIL, NIL, @cExt )
@@ -1142,8 +1142,8 @@ METHOD LoadReportFile( cFrmFile ) CLASS HBReportForm
*/
METHOD GetExpr( nPointer ) CLASS HBReportForm
LOCAL nExprOffset
LOCAL nExprLength
LOCAL nExprOffset
LOCAL nExprLength
LOCAL nOffsetOffset := 0
LOCAL cString := ""
@@ -1314,6 +1314,8 @@ METHOD GetColumn( cFieldsBuffer, nOffset ) CLASS HBReportForm
aColumn[ RCT_PICT ] := Replicate("X", aColumn[ RCT_WIDTH ])
CASE cType == "D"
aColumn[ RCT_PICT ] := "@D"
CASE cType == "T"
aColumn[ RCT_PICT ] := "@T"
CASE cType == "N"
IF aColumn[ RCT_DECIMALS ] != 0
aColumn[ RCT_PICT ] := Replicate("9", aColumn[ RCT_WIDTH ] - aColumn[ RCT_DECIMALS ] -1) + "." + ;
@@ -1377,6 +1379,8 @@ STATIC FUNCTION MakeAStr( uVar, cType )
DO CASE
CASE Upper( cType ) == "D"
cString := DToC( uVar )
CASE Upper( cType ) == "T"
cString := hb_TToC( uVar )
CASE Upper( cType ) == "L"
cString := iif( uVar, "T", "F" )
CASE Upper( cType ) == "N"