2012-11-07 00:36 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbct/hbct.hbx
* contrib/hbfbird/hbfbird.hbx
* contrib/hbgd/hbgd.hbx
* minor fixes
* contrib/hbamf/hbamfobj.prg
* contrib/hbamf/tests/tstendin.prg
* contrib/hbblat/blatcls.prg
* contrib/hbblat/tests/blatcmd.prg
* contrib/hbbz2/tests/test.prg
* contrib/hbct/tests/*.prg
* contrib/hbfbird/tfirebrd.prg
* contrib/hbfimage/tests/fitest.prg
* contrib/hbgd/*.prg
* contrib/hbgd/tests/*.prg
* contrib/hbmisc/*.prg
* contrib/hbmisc/tests/*.prg
* reformatted
! commented code deleted or converted to #if 0/#endif block
This commit is contained in:
@@ -16,6 +16,27 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-11-07 00:36 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbct/hbct.hbx
|
||||
* contrib/hbfbird/hbfbird.hbx
|
||||
* contrib/hbgd/hbgd.hbx
|
||||
* minor fixes
|
||||
|
||||
* contrib/hbamf/hbamfobj.prg
|
||||
* contrib/hbamf/tests/tstendin.prg
|
||||
* contrib/hbblat/blatcls.prg
|
||||
* contrib/hbblat/tests/blatcmd.prg
|
||||
* contrib/hbbz2/tests/test.prg
|
||||
* contrib/hbct/tests/*.prg
|
||||
* contrib/hbfbird/tfirebrd.prg
|
||||
* contrib/hbfimage/tests/fitest.prg
|
||||
* contrib/hbgd/*.prg
|
||||
* contrib/hbgd/tests/*.prg
|
||||
* contrib/hbmisc/*.prg
|
||||
* contrib/hbmisc/tests/*.prg
|
||||
* reformatted
|
||||
! commented code deleted or converted to #if 0/#endif block
|
||||
|
||||
2012-11-06 22:33 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/gtwvg/combobox.prg
|
||||
* contrib/gtwvg/listbox.prg
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
CREATE CLASS AMF_Obj
|
||||
CREATE CLASS amf_Obj
|
||||
|
||||
METHOD New( hCachedData ) CONSTRUCTOR
|
||||
ERROR HANDLER noMessage
|
||||
@@ -36,17 +36,17 @@ CREATE CLASS AMF_Obj
|
||||
|
||||
END CLASS
|
||||
|
||||
METHOD New( hCachedData ) CLASS AMF_Obj
|
||||
METHOD New( hCachedData ) CLASS amf_Obj
|
||||
|
||||
::hCachedData := hCachedData
|
||||
|
||||
RETURN self
|
||||
|
||||
METHOD noMessage( ... ) CLASS AMF_Obj
|
||||
METHOD noMessage( ... ) CLASS amf_Obj
|
||||
|
||||
RETURN ::msgNotFound( __GetMessage(), ... )
|
||||
|
||||
METHOD msgNotFound( cMessage, ... ) CLASS AMF_Obj
|
||||
METHOD msgNotFound( cMessage, ... ) CLASS amf_Obj
|
||||
|
||||
IF PCount() == 1 .AND. !( hb_BLeft( cMessage, 1 ) == "_" )
|
||||
IF ! Empty( ::hCachedData ) .AND. hb_HHasKey( ::hCachedData, cMessage )
|
||||
@@ -61,7 +61,7 @@ METHOD msgNotFound( cMessage, ... ) CLASS AMF_Obj
|
||||
|
||||
RETURN NIL
|
||||
|
||||
CREATE CLASS AMF_Raw
|
||||
CREATE CLASS amf_Raw
|
||||
|
||||
METHOD New( cData ) CONSTRUCTOR
|
||||
METHOD GetData INLINE ::cData
|
||||
@@ -71,7 +71,7 @@ CREATE CLASS AMF_Raw
|
||||
|
||||
END CLASS
|
||||
|
||||
METHOD New( cData ) CLASS AMF_Raw
|
||||
METHOD New( cData ) CLASS amf_Raw
|
||||
|
||||
::cData := cData
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ PROCEDURE Main()
|
||||
TEST 268435456000, "4271"
|
||||
TEST -1, "FE11"
|
||||
TEST 9007199254740990, "0009"
|
||||
TEST AMF3_DECODE( AMF3_ENCODE( 9007199254740990 ) ), "0009"
|
||||
TEST amf3_Decode( amf3_Encode( 9007199254740990 ) ), "0009"
|
||||
TEST 9007199254740991, "8918"
|
||||
TEST AMF3_DECODE( AMF3_ENCODE( 9007199254740991 ) ), "8918"
|
||||
TEST amf3_Decode( amf3_Encode( 9007199254740991 ) ), "8918"
|
||||
TEST 9007199254740991.00, "8918"
|
||||
TEST 6969.69, "10AF"
|
||||
TEST NIL, "F1E1"
|
||||
@@ -38,7 +38,7 @@ PROCEDURE Main()
|
||||
|
||||
STATIC PROCEDURE _TEST( a, cChkOK )
|
||||
|
||||
LOCAL x := AMF3_ENCODE( a )
|
||||
LOCAL x := amf3_Encode( a )
|
||||
LOCAL cChk := hb_StrToHex( I2Bin( hb_CRC( x ) ) )
|
||||
|
||||
? PadL( hb_ValToExp( a ), 18 ), hb_StrToHex( x, " " ), "CHECKSUM", cChk, iif( ! Empty( cChkOK ) .AND. !( cChk == cChkOK ), "!TEST FAILED!, should be " + cChkOK, " " )
|
||||
|
||||
@@ -213,7 +213,7 @@ METHOD Send() CLASS HBBlat
|
||||
::Check()
|
||||
|
||||
IF ::nError == BLAT_SUCCESS
|
||||
::nBlatError := hb_BlatSend( ::cCommand )
|
||||
::nBlatError := hb_blatSend( ::cCommand )
|
||||
IF ::nBlatError != 0
|
||||
::nError := ::nBlatError
|
||||
::cError := BLAT_TEXT_ERROR
|
||||
@@ -304,7 +304,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// nMaxNames
|
||||
IF HB_ISNUMERIC( ::nMaxNames ) .AND. ::nMaxNames > 0
|
||||
::cCommand += ' -maxNames ' + hb_ntos( ::nMaxNames )
|
||||
::cCommand += " -maxNames " + hb_ntos( ::nMaxNames )
|
||||
ENDIF
|
||||
|
||||
// lToUndiscloseRecipients
|
||||
@@ -332,7 +332,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
RETURN
|
||||
ENDIF
|
||||
ELSE
|
||||
::cCommand += ' -sf ' + ::cSubjectFile
|
||||
::cCommand += " -sf " + ::cSubjectFile
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -385,7 +385,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
RETURN
|
||||
ENDIF
|
||||
ELSE
|
||||
::cCommand += ' -sig ' + ::cSignatureFile
|
||||
::cCommand += " -sig " + ::cSignatureFile
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -399,7 +399,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
RETURN
|
||||
ENDIF
|
||||
ELSE
|
||||
::cCommand += ' -tag ' + ::cTagFile
|
||||
::cCommand += " -tag " + ::cTagFile
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -413,7 +413,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
RETURN
|
||||
ENDIF
|
||||
ELSE
|
||||
::cCommand += ' -ps ' + ::cPostScriptumFile
|
||||
::cCommand += " -ps " + ::cPostScriptumFile
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -475,72 +475,72 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cReplyTo
|
||||
IF HB_ISSTRING( ::cReplyTo )
|
||||
::cCommand += ' -replyto ' + ::cReplyTo
|
||||
::cCommand += " -replyto " + ::cReplyTo
|
||||
ENDIF
|
||||
|
||||
// cReplyTo
|
||||
IF HB_ISSTRING( ::cReplyTo )
|
||||
::cCommand += ' -replyto ' + ::cReplyTo
|
||||
::cCommand += " -replyto " + ::cReplyTo
|
||||
ENDIF
|
||||
|
||||
// cReturnPath
|
||||
IF HB_ISSTRING( ::cReturnPath )
|
||||
::cCommand += ' -returnpath ' + ::cReturnPath
|
||||
::cCommand += " -returnpath " + ::cReturnPath
|
||||
ENDIF
|
||||
|
||||
// cSender
|
||||
IF HB_ISSTRING( ::cSender )
|
||||
::cCommand += ' -sender ' + ::cSender
|
||||
::cCommand += " -sender " + ::cSender
|
||||
ENDIF
|
||||
|
||||
// nPortSMTP
|
||||
IF HB_ISNUMERIC( ::nPortSMTP ) .AND. ::nPortSMTP > 0
|
||||
::cCommand += ' -portSMTP ' + hb_ntos( ::nPortSMTP )
|
||||
::cCommand += " -portSMTP " + hb_ntos( ::nPortSMTP )
|
||||
ENDIF
|
||||
|
||||
// nPortNNTP
|
||||
IF HB_ISNUMERIC( ::nPortNNTP ) .AND. ::nPortNNTP > 0
|
||||
::cCommand += ' -portNNTP ' + hb_ntos( ::nPortNNTP )
|
||||
::cCommand += " -portNNTP " + hb_ntos( ::nPortNNTP )
|
||||
ENDIF
|
||||
|
||||
// nPortPOP3
|
||||
IF HB_ISNUMERIC( ::nPortPOP3 ) .AND. ::nPortPOP3 > 0
|
||||
::cCommand += ' -portPOP3 ' + hb_ntos( ::nPortPOP3 )
|
||||
::cCommand += " -portPOP3 " + hb_ntos( ::nPortPOP3 )
|
||||
ENDIF
|
||||
|
||||
// nPortIMAP
|
||||
IF HB_ISNUMERIC( ::nPortIMAP ) .AND. ::nPortIMAP > 0
|
||||
::cCommand += ' -portIMAP ' + hb_ntos( ::nPortIMAP )
|
||||
::cCommand += " -portIMAP " + hb_ntos( ::nPortIMAP )
|
||||
ENDIF
|
||||
|
||||
// cUserAUTH
|
||||
IF HB_ISSTRING( ::cUserAUTH )
|
||||
::cCommand += ' -u ' + ::cUserAUTH
|
||||
::cCommand += " -u " + ::cUserAUTH
|
||||
ENDIF
|
||||
|
||||
// cPasswordAUTH
|
||||
IF HB_ISSTRING( ::cPasswordAUTH )
|
||||
::cCommand += ' -pw ' + ::cPasswordAUTH
|
||||
::cCommand += " -pw " + ::cPasswordAUTH
|
||||
ENDIF
|
||||
|
||||
// cUserPOP3
|
||||
IF HB_ISSTRING( ::cUserPOP3 )
|
||||
::cCommand += ' -pu ' + ::cUserPOP3
|
||||
::cCommand += " -pu " + ::cUserPOP3
|
||||
ENDIF
|
||||
|
||||
// cPasswordPOP3
|
||||
IF HB_ISSTRING( ::cPasswordPOP3 )
|
||||
::cCommand += ' -ppw ' + ::cPasswordPOP3
|
||||
::cCommand += " -ppw " + ::cPasswordPOP3
|
||||
ENDIF
|
||||
|
||||
// cUserIMAP
|
||||
IF HB_ISSTRING( ::cUserIMAP )
|
||||
::cCommand += ' -iu ' + ::cUserIMAP
|
||||
::cCommand += " -iu " + ::cUserIMAP
|
||||
ENDIF
|
||||
|
||||
// cPasswordIMAP
|
||||
IF HB_ISSTRING( ::cPasswordIMAP )
|
||||
::cCommand += ' -ipw ' + ::cPasswordIMAP
|
||||
::cCommand += " -ipw " + ::cPasswordIMAP
|
||||
ENDIF
|
||||
|
||||
// lNoMD5
|
||||
@@ -552,17 +552,17 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cOrganization
|
||||
IF HB_ISSTRING( ::cOrganization )
|
||||
::cCommand += ' -organization ' + ::cOrganization
|
||||
::cCommand += " -organization " + ::cOrganization
|
||||
ENDIF
|
||||
|
||||
// cUserAgent
|
||||
IF HB_ISSTRING( ::cUserAgent )
|
||||
::cCommand += ' -ua ' + ::cUserAgent
|
||||
::cCommand += " -ua " + ::cUserAgent
|
||||
ENDIF
|
||||
|
||||
// cXHeader
|
||||
IF HB_ISSTRING( ::cXHeader )
|
||||
::cCommand += ' -x ' + ::cXHeader
|
||||
::cCommand += " -x " + ::cXHeader
|
||||
ENDIF
|
||||
|
||||
// NoBlatHeader
|
||||
@@ -590,17 +590,17 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cCharSet
|
||||
IF HB_ISSTRING( ::cCharSet )
|
||||
::cCommand += ' -charset ' + ::cCharSet
|
||||
::cCommand += " -charset " + ::cCharSet
|
||||
ENDIF
|
||||
|
||||
// cUserHeader1
|
||||
IF HB_ISSTRING( ::cUserHeader1 )
|
||||
::cCommand += ' -a1 ' + ::cUserHeader1
|
||||
::cCommand += " -a1 " + ::cUserHeader1
|
||||
ENDIF
|
||||
|
||||
// cUserHeader2
|
||||
IF HB_ISSTRING( ::cUserHeader2 )
|
||||
::cCommand += ' -a2 ' + ::cUserHeader2
|
||||
::cCommand += " -a2 " + ::cUserHeader2
|
||||
ENDIF
|
||||
|
||||
// cDSN
|
||||
@@ -763,7 +763,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cAlternateText - optional
|
||||
IF HB_ISSTRING( ::cAlternateText )
|
||||
::cCommand += ' -alttext ' + ::cAlternateText
|
||||
::cCommand += " -alttext " + ::cAlternateText
|
||||
ENDIF
|
||||
|
||||
// cAlternateTextFile - optional
|
||||
@@ -802,7 +802,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cContentType - optional
|
||||
IF HB_ISSTRING( ::cContentType )
|
||||
::cCommand += ' -contentType ' + ::cContentType
|
||||
::cCommand += " -contentType " + ::cContentType
|
||||
ENDIF
|
||||
|
||||
// NNTP specific options ------------------
|
||||
@@ -838,7 +838,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cLogFile
|
||||
IF HB_ISSTRING( ::cLogFile )
|
||||
::cCommand += ' -log ' + ::cLogFile
|
||||
::cCommand += " -log " + ::cLogFile
|
||||
ENDIF
|
||||
|
||||
// lLogTimestamp
|
||||
@@ -872,7 +872,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cHostname
|
||||
IF HB_ISSTRING( ::cHostname )
|
||||
::cCommand += ' -hostname ' + ::cHostname
|
||||
::cCommand += " -hostname " + ::cHostname
|
||||
ENDIF
|
||||
|
||||
// lRaw
|
||||
@@ -887,7 +887,7 @@ METHOD PROCEDURE Check() CLASS HBBlat
|
||||
|
||||
// cCommentChar
|
||||
IF HB_ISSTRING( ::cCommentChar )
|
||||
::cCommand += ' -comment ' + ::cCommentChar
|
||||
::cCommand += " -comment " + ::cCommentChar
|
||||
ENDIF
|
||||
|
||||
// lSuperDebug
|
||||
@@ -966,7 +966,7 @@ METHOD TranslateBlatError( nErr ) CLASS HBBlat
|
||||
cError := aErrors[ nPos, 2 ]
|
||||
ENDIF
|
||||
|
||||
/*
|
||||
#if 0
|
||||
SWITCH nErr
|
||||
CASE BLAT_SUCCESS
|
||||
cError := BLAT_TEXT_SUCCESS
|
||||
@@ -979,7 +979,7 @@ METHOD TranslateBlatError( nErr ) CLASS HBBlat
|
||||
OTHERWISE
|
||||
cError := BLAT_TEXT_ERR_UNKNOWN
|
||||
ENDSWITCH
|
||||
*/
|
||||
#endif
|
||||
|
||||
RETURN cError
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ PROCEDURE Main()
|
||||
? "Try with -? option"
|
||||
ELSE
|
||||
? "Sending parameters to blat"
|
||||
nRet := hb_BlatSend( cCmd )
|
||||
nRet := hb_blatSend( cCmd )
|
||||
? nRet
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ PROCEDURE Main()
|
||||
LOCAL cI, cJ, nErr
|
||||
|
||||
cI := "Hello"
|
||||
cJ := HB_BZ2_COMPRESS( cI, , @nErr )
|
||||
cJ := hb_bz2_Compress( cI, , @nErr )
|
||||
? nErr, Len( cJ ), hb_StrToHex( cJ )
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
STATIC s_bInitialized := .F.
|
||||
|
||||
FUNCTION CTINIT()
|
||||
FUNCTION ctinit()
|
||||
|
||||
IF ! s_bInitialized
|
||||
s_bInitialized := ctcinit()
|
||||
@@ -70,7 +70,7 @@ INIT PROCEDURE _CTINIT()
|
||||
|
||||
RETURN
|
||||
|
||||
FUNCTION CTEXIT()
|
||||
FUNCTION ctexit()
|
||||
|
||||
IF s_bInitialized
|
||||
ctcexit()
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION dsetkbios( lNewKeyboardMode )
|
||||
FUNCTION DSetKBIOS( lNewKeyboardMode )
|
||||
|
||||
THREAD STATIC t_lKeyboardMode := .T.
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ FUNCTION AlloFree( lMode )
|
||||
|
||||
RETURN Memory( iif( lMode, HB_MEM_CHAR, HB_MEM_BLOCK ) )
|
||||
|
||||
FUNCTION CENTER( c, n, p, lMode )
|
||||
FUNCTION Center( c, n, p, lMode )
|
||||
|
||||
LOCAL cRet
|
||||
|
||||
@@ -87,7 +87,7 @@ FUNCTION CENTER( c, n, p, lMode )
|
||||
|
||||
RETURN iif( lMode, cRet, RTrim( cRet ) )
|
||||
|
||||
FUNCTION CSETCURS( l )
|
||||
FUNCTION CSetCurs( l )
|
||||
|
||||
IF ! HB_ISLOGICAL( l )
|
||||
RETURN SetCursor() != SC_NONE
|
||||
@@ -95,19 +95,19 @@ FUNCTION CSETCURS( l )
|
||||
|
||||
RETURN SetCursor( iif( l, SC_NORMAL, SC_NONE ) ) != SC_NONE
|
||||
|
||||
FUNCTION CSETKEY( n )
|
||||
FUNCTION CSetKey( n )
|
||||
|
||||
RETURN SetKey( n )
|
||||
|
||||
FUNCTION CSETCENT( nCentury )
|
||||
FUNCTION CSetCent( nCentury )
|
||||
|
||||
RETURN __SetCentury( nCentury )
|
||||
|
||||
FUNCTION LTOC( l )
|
||||
FUNCTION LToC( l )
|
||||
|
||||
RETURN iif( l, "T", "F" )
|
||||
|
||||
FUNCTION DOSPARAM()
|
||||
FUNCTION DosParam()
|
||||
|
||||
LOCAL cRet := ""
|
||||
LOCAL nCount := hb_argc(), i
|
||||
@@ -118,6 +118,6 @@ FUNCTION DOSPARAM()
|
||||
|
||||
RETURN cRet
|
||||
|
||||
FUNCTION EXENAME()
|
||||
FUNCTION ExeName()
|
||||
|
||||
RETURN hb_ProgName()
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION TIMETOSEC( cTime )
|
||||
FUNCTION TimeToSec( cTime )
|
||||
|
||||
LOCAL nSec := 0
|
||||
LOCAL nLen, i, aLim, aMod, nInd, n
|
||||
@@ -81,7 +81,7 @@ FUNCTION TIMETOSEC( cTime )
|
||||
|
||||
RETURN Round( nSec, 2 ) /* round FL val to be sure that you can compare it */
|
||||
|
||||
FUNCTION SECTOTIME( nSec, lHundr )
|
||||
FUNCTION SecToTime( nSec, lHundr )
|
||||
|
||||
LOCAL i, h, n
|
||||
|
||||
@@ -102,7 +102,7 @@ FUNCTION SECTOTIME( nSec, lHundr )
|
||||
|
||||
RETURN h
|
||||
|
||||
FUNCTION MILLISEC( nDelay )
|
||||
FUNCTION Millisec( nDelay )
|
||||
|
||||
hb_idleSleep( nDelay / 1000 )
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ THREAD STATIC t_fileTime
|
||||
* same name that causes GPF's.
|
||||
*/
|
||||
|
||||
FUNCTION FILECOPY( cSource, cDest, lMode )
|
||||
FUNCTION FileCopy( cSource, cDest, lMode )
|
||||
|
||||
LOCAL hDstFile
|
||||
LOCAL cBuffer := Space( F_BLOCK )
|
||||
@@ -116,10 +116,10 @@ FUNCTION FILECOPY( cSource, cDest, lMode )
|
||||
FClose( t_hSrcFile )
|
||||
t_hSrcFile := F_ERROR
|
||||
ENDIF
|
||||
t_fileDate := FILEDATE( cSource )
|
||||
t_fileTime := FILETIME( cSource )
|
||||
t_fileDate := FileDate( cSource )
|
||||
t_fileTime := FileTime( cSource )
|
||||
IF t_lSetDaTi
|
||||
SETFDATI( cDest, t_fileDate, t_fileTime )
|
||||
SetFDaTi( cDest, t_fileDate, t_fileTime )
|
||||
ENDIF
|
||||
ELSE
|
||||
FClose( t_hSrcFile )
|
||||
@@ -129,11 +129,11 @@ FUNCTION FILECOPY( cSource, cDest, lMode )
|
||||
|
||||
RETURN nTotBytes
|
||||
|
||||
FUNCTION FILECOPEN()
|
||||
FUNCTION FileCOpen()
|
||||
|
||||
RETURN t_hSrcFile != F_ERROR
|
||||
|
||||
FUNCTION FILECDATI( lNewMode )
|
||||
FUNCTION FileCDaTi( lNewMode )
|
||||
|
||||
LOCAL lOldMode := t_lSetDaTi
|
||||
|
||||
@@ -143,7 +143,7 @@ FUNCTION FILECDATI( lNewMode )
|
||||
|
||||
RETURN lOldMode
|
||||
|
||||
FUNCTION FILECCONT( cDest )
|
||||
FUNCTION FileCCont( cDest )
|
||||
|
||||
LOCAL hDstFile
|
||||
LOCAL cBuffer := Space( F_BLOCK )
|
||||
@@ -173,14 +173,14 @@ FUNCTION FILECCONT( cDest )
|
||||
t_hSrcFile := F_ERROR
|
||||
ENDIF
|
||||
IF t_lSetDaTi
|
||||
SETFDATI( cDest, t_fileDate, t_fileTime )
|
||||
SetFDaTi( cDest, t_fileDate, t_fileTime )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN nTotBytes
|
||||
|
||||
FUNCTION FILECCLOSE()
|
||||
FUNCTION FileCCLose()
|
||||
|
||||
IF t_hSrcFile != F_ERROR
|
||||
FClose( t_hSrcFile )
|
||||
@@ -190,7 +190,7 @@ FUNCTION FILECCLOSE()
|
||||
|
||||
RETURN .F.
|
||||
|
||||
FUNCTION FILEAPPEND( cSrc, cDest )
|
||||
FUNCTION FileAppend( cSrc, cDest )
|
||||
|
||||
LOCAL cBuffer := Space( F_BLOCK )
|
||||
LOCAL hSrcFile, hDstFile
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
MEMVAR GetList
|
||||
|
||||
FUNCTION SAVEGETS()
|
||||
FUNCTION SaveGets()
|
||||
|
||||
LOCAL aGetList := GetList
|
||||
|
||||
@@ -63,21 +63,21 @@ FUNCTION SAVEGETS()
|
||||
|
||||
RETURN aGetList
|
||||
|
||||
FUNCTION RESTGETS( aGetList )
|
||||
FUNCTION RestGets( aGetList )
|
||||
|
||||
RETURN ( GetList := aGetList ) != NIL
|
||||
|
||||
FUNCTION COUNTGETS()
|
||||
FUNCTION CountGets()
|
||||
|
||||
RETURN Len( GetList )
|
||||
|
||||
FUNCTION CURRENTGET()
|
||||
FUNCTION CurrentGet()
|
||||
|
||||
LOCAL oActive := GetActive()
|
||||
|
||||
RETURN AScan( GetList, {| oGet | oGet == oActive } )
|
||||
|
||||
FUNCTION GETFLDROW( nField )
|
||||
FUNCTION GetFldRow( nField )
|
||||
|
||||
LOCAL oGet
|
||||
|
||||
@@ -89,7 +89,7 @@ FUNCTION GETFLDROW( nField )
|
||||
|
||||
RETURN iif( oGet != NIL, oGet:Row, -1 )
|
||||
|
||||
FUNCTION GETFLDCOL( nField )
|
||||
FUNCTION GetFldCol( nField )
|
||||
|
||||
LOCAL oGet
|
||||
|
||||
@@ -101,7 +101,7 @@ FUNCTION GETFLDCOL( nField )
|
||||
|
||||
RETURN iif( oGet != NIL, oGet:Col, -1 )
|
||||
|
||||
FUNCTION GETFLDVAR( nField )
|
||||
FUNCTION GetFldVar( nField )
|
||||
|
||||
LOCAL oGet
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION GETINPUT( xVar, nRow, nCol, lSay, xPrompt )
|
||||
FUNCTION GetInput( xVar, nRow, nCol, lSay, xPrompt )
|
||||
|
||||
LOCAL nCursorRow := Row()
|
||||
LOCAL nCursorCol := Col()
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
#include "getexit.ch"
|
||||
|
||||
FUNCTION GETSECRET( cVar, nRow, nCol, lSay, xPrompt )
|
||||
FUNCTION GetSecret( cVar, nRow, nCol, lSay, xPrompt )
|
||||
|
||||
LOCAL nCursorRow := Row()
|
||||
LOCAL nCursorCol := Col()
|
||||
@@ -98,7 +98,9 @@ FUNCTION GETSECRET( cVar, nRow, nCol, lSay, xPrompt )
|
||||
|
||||
STATIC FUNCTION _HIDE( cVar )
|
||||
|
||||
/* RETURN RangeRepl( Asc( " " ) + 1, 255, cVar, "*" ) */
|
||||
#if 0
|
||||
RETURN RangeRepl( Asc( " " ) + 1, 255, cVar, "*" )
|
||||
#endif
|
||||
|
||||
RETURN PadR( Replicate( "*", Len( RTrim( cVar ) ) ), Len( cVar ) )
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ DYNAMIC PadLeft
|
||||
DYNAMIC PadRight
|
||||
DYNAMIC Payment
|
||||
DYNAMIC Periods
|
||||
DYNAMIC PI
|
||||
DYNAMIC Pi
|
||||
DYNAMIC PosAlpha
|
||||
DYNAMIC PosChar
|
||||
DYNAMIC PosDel
|
||||
@@ -300,7 +300,7 @@ DYNAMIC ReplLeft
|
||||
DYNAMIC ReplRight
|
||||
DYNAMIC RestCursor
|
||||
DYNAMIC RestGets
|
||||
DYNAMIC RestSetKEY
|
||||
DYNAMIC RestSetKey
|
||||
DYNAMIC RestToken
|
||||
DYNAMIC RToD
|
||||
DYNAMIC SaveCursor
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION SAVESETKEY()
|
||||
FUNCTION SaveSetKey()
|
||||
|
||||
RETURN hb_SetKeySave()
|
||||
|
||||
FUNCTION RESTSETKEY( aSavedTraps )
|
||||
FUNCTION RestSetKey( aSavedTraps )
|
||||
|
||||
hb_SetKeySave( aSavedTraps )
|
||||
|
||||
|
||||
@@ -343,18 +343,18 @@ FUNCTION __hbct_key_n_to_c( nKey )
|
||||
|
||||
RETURN hb_BChar( 0 ) + hb_BChar( 0 )
|
||||
|
||||
FUNCTION setkxlat( cOrgKeyValue, cNewKeyValue )
|
||||
FUNCTION SetKXLat( cOrgKeyValue, cNewKeyValue )
|
||||
|
||||
SWITCH PCount()
|
||||
CASE 0 ; RETURN hbct_setkxlat()
|
||||
CASE 1 ; RETURN hbct_setkxlat( __hbct_key_c_to_n( cOrgKeyValue ) )
|
||||
CASE 0 ; RETURN hbct_SetKXLat()
|
||||
CASE 1 ; RETURN hbct_SetKXLat( __hbct_key_c_to_n( cOrgKeyValue ) )
|
||||
ENDSWITCH
|
||||
|
||||
RETURN hbct_setkxlat( __hbct_key_c_to_n( cOrgKeyValue ), __hbct_key_c_to_n( cNewKeyValue ) )
|
||||
RETURN hbct_SetKXLat( __hbct_key_c_to_n( cOrgKeyValue ), __hbct_key_c_to_n( cNewKeyValue ) )
|
||||
|
||||
FUNCTION getkxlat( cKeyValue )
|
||||
FUNCTION GetKXLat( cKeyValue )
|
||||
|
||||
LOCAL xKey := hbct_getkxlat( __hbct_key_c_to_n( cKeyValue ) )
|
||||
LOCAL xKey := hbct_GetKXLat( __hbct_key_c_to_n( cKeyValue ) )
|
||||
|
||||
/* doc is unclear. should this return a numeric in these cases? */
|
||||
IF HB_ISNUMERIC( xKey )
|
||||
@@ -363,7 +363,7 @@ FUNCTION getkxlat( cKeyValue )
|
||||
|
||||
RETURN __hbct_key_n_to_c( xKey )
|
||||
|
||||
FUNCTION setkxtab( cTrs )
|
||||
FUNCTION SetKXTab( cTrs )
|
||||
|
||||
LOCAL hTrs := { => }
|
||||
LOCAL tmp
|
||||
@@ -374,12 +374,12 @@ FUNCTION setkxtab( cTrs )
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
RETURN hbct_setkxtab( hTrs )
|
||||
RETURN hbct_SetKXTab( hTrs )
|
||||
|
||||
FUNCTION getkxtab()
|
||||
FUNCTION GetKXTab()
|
||||
|
||||
LOCAL cTrs := ""
|
||||
LOCAL hTrs := hbct_getkxtab()
|
||||
LOCAL hTrs := hbct_GetKXTab()
|
||||
LOCAL hKey
|
||||
|
||||
FOR EACH hKey IN hTrs
|
||||
@@ -390,7 +390,7 @@ FUNCTION getkxtab()
|
||||
|
||||
/* Harbour extensions using standard numeric key values */
|
||||
|
||||
FUNCTION hbct_setkxlat( nOrgKeyValue, nNewKeyValue )
|
||||
FUNCTION hbct_SetKXLat( nOrgKeyValue, nNewKeyValue )
|
||||
|
||||
LOCAL lAccepted := .F.
|
||||
|
||||
@@ -431,7 +431,7 @@ FUNCTION hbct_setkxlat( nOrgKeyValue, nNewKeyValue )
|
||||
|
||||
RETURN lAccepted
|
||||
|
||||
FUNCTION hbct_getkxlat( nKeyValue )
|
||||
FUNCTION hbct_GetKXLat( nKeyValue )
|
||||
|
||||
LOCAL nNewValue := 0
|
||||
|
||||
@@ -449,7 +449,7 @@ FUNCTION hbct_getkxlat( nKeyValue )
|
||||
|
||||
RETURN nNewValue
|
||||
|
||||
FUNCTION hbct_setkxtab( hTrs )
|
||||
FUNCTION hbct_SetKXTab( hTrs )
|
||||
|
||||
LOCAL lAccepted := .F.
|
||||
|
||||
@@ -471,7 +471,7 @@ FUNCTION hbct_setkxtab( hTrs )
|
||||
|
||||
RETURN lAccepted
|
||||
|
||||
FUNCTION hbct_getkxtab()
|
||||
FUNCTION hbct_GetKXTab()
|
||||
|
||||
LOCAL xRetVal
|
||||
|
||||
|
||||
@@ -53,22 +53,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION CLEAREOL( nRow, nCol, xAttr, xChar )
|
||||
FUNCTION ClearEol( nRow, nCol, xAttr, xChar )
|
||||
|
||||
IF ! HB_ISNUMERIC( nRow )
|
||||
nRow := Row()
|
||||
ENDIF
|
||||
|
||||
RETURN CLEARWIN( nRow, nCol, nRow, /* MaxCol() */, xAttr, xChar )
|
||||
RETURN ClearWin( nRow, nCol, nRow, /* MaxCol() */, xAttr, xChar )
|
||||
|
||||
FUNCTION CLEOL( nRow, nCol )
|
||||
FUNCTION ClEol( nRow, nCol )
|
||||
|
||||
IF ! HB_ISNUMERIC( nRow )
|
||||
nRow := Row()
|
||||
ENDIF
|
||||
|
||||
RETURN CLEARWIN( nRow, nCol, nRow, /* MaxCol() */, 7 /* "W/N" */, " " )
|
||||
RETURN ClearWin( nRow, nCol, nRow, /* MaxCol() */, 7 /* "W/N" */, " " )
|
||||
|
||||
FUNCTION CLWIN( nRow, nCol )
|
||||
FUNCTION ClWin( nRow, nCol )
|
||||
|
||||
RETURN CLEARWIN( nRow, nCol, /* MaxRow() */, /* MaxCol() */, 7 /* "W/N" */, " " )
|
||||
RETURN ClearWin( nRow, nCol, /* MaxRow() */, /* MaxCol() */, 7 /* "W/N" */, " " )
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION SCREENMARK( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing )
|
||||
FUNCTION ScreenMark( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing )
|
||||
|
||||
LOCAL lFound := .F.
|
||||
LOCAL nCount := 1
|
||||
@@ -76,7 +76,7 @@ FUNCTION SCREENMARK( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing )
|
||||
ENDIF
|
||||
|
||||
nCols := MaxCol()
|
||||
cScreen := SCREENTEXT( 0, 0, MaxRow(), nCols++ )
|
||||
cScreen := ScreenText( 0, 0, MaxRow(), nCols++ )
|
||||
nLen := Len( cSearch )
|
||||
nLast := Len( cScreen ) - nLen + 1
|
||||
|
||||
@@ -85,7 +85,7 @@ FUNCTION SCREENMARK( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing )
|
||||
cScreen := Upper( cScreen )
|
||||
ENDIF
|
||||
|
||||
DO WHILE ( nAt := ATNUM( cSearch, cScreen, nCount ) ) != 0
|
||||
DO WHILE ( nAt := AtNum( cSearch, cScreen, nCount ) ) != 0
|
||||
IF ( nAt == 1 .OR. cForward == NIL .OR. ;
|
||||
SubStr( cScreen, nAt, 1 ) $ cForward ) .AND. ;
|
||||
( nAt == nLast .OR. cTrailing == NIL .OR. ;
|
||||
@@ -95,12 +95,12 @@ FUNCTION SCREENMARK( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing )
|
||||
nRow := Int( nAt / nCols )
|
||||
nCol := Int( nAt % nCols )
|
||||
nEnd := nCol + Len( cSearch ) - 1
|
||||
COLORWIN( nRow, nCol, nRow, nEnd, xAttr )
|
||||
ColorWin( nRow, nCol, nRow, nEnd, xAttr )
|
||||
DO WHILE nEnd >= nCols
|
||||
nEnd -= nCols
|
||||
nCol := 0
|
||||
++nRow
|
||||
COLORWIN( nRow, nCol, nRow, nEnd, xAttr )
|
||||
ColorWin( nRow, nCol, nRow, nEnd, xAttr )
|
||||
ENDDO
|
||||
IF ! lAll
|
||||
EXIT
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FUNCTION SHOWTIME( nRow, nCol, lNoSec, cColor, l12, lAmPm )
|
||||
FUNCTION ShowTime( nRow, nCol, lNoSec, cColor, l12, lAmPm )
|
||||
|
||||
THREAD STATIC t_hTimer := NIL
|
||||
|
||||
|
||||
@@ -62,41 +62,41 @@ PROCEDURE Main()
|
||||
?
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' This should be "1000": ' + addascii( "0000", 1, 1 )
|
||||
? ' This should be "0001": ' + addascii( "0000", 1 )
|
||||
? ' This should be "BAAA": ' + addascii( "AAAA", -255, 1 )
|
||||
? ' This should be "AAAB": ' + addascii( "AAAA", -255 )
|
||||
? ' This should be "1000": ' + AddAscii( "0000", 1, 1 )
|
||||
? ' This should be "0001": ' + AddAscii( "0000", 1 )
|
||||
? ' This should be "BAAA": ' + AddAscii( "AAAA", -255, 1 )
|
||||
? ' This should be "AAAB": ' + AddAscii( "AAAA", -255 )
|
||||
|
||||
// csetref() tests
|
||||
?
|
||||
? "CSETREF tests:"
|
||||
? " current csetref setting(should be .F.)................: ", csetref()
|
||||
? " return value of addascii([A],1,1) call(should be 'B'): ", addascii( "A", 1, 1 )
|
||||
? " current csetref setting(should be .F.)................: ", CSetRef()
|
||||
? " return value of addascii([A],1,1) call(should be 'B'): ", AddAscii( "A", 1, 1 )
|
||||
? " value of cStr..........................................: ", cStr
|
||||
? " return value of addascii(cStr,1,1) call...............: ", addascii( cStr, 1, 1 )
|
||||
? " return value of addascii(cStr,1,1) call...............: ", AddAscii( cStr, 1, 1 )
|
||||
? " value of cStr is now...................................: ", cStr
|
||||
? " return value of addascii(@cStr,1,1) call..............: ", addascii( @cStr, 1, 1 )
|
||||
? " return value of addascii(@cStr,1,1) call..............: ", AddAscii( @cStr, 1, 1 )
|
||||
? " value of cStr is now...................................: ", cStr
|
||||
? " return value of addascii(@cStr,-1,1) call.............: ", addascii( @cStr, -1, 1 )
|
||||
? " return value of addascii(@cStr,-1,1) call.............: ", AddAscii( @cStr, -1, 1 )
|
||||
? " value of cStr is now...................................: ", cStr
|
||||
? " return value of csetref(.T.)..........................: ", csetref( .T. )
|
||||
? " return value of addascii([A],1,1) call................: ", addascii( "A", 1, 1 )
|
||||
? " return value of addascii(cStr,1,1) call...............: ", addascii( cStr, 1, 1 )
|
||||
? " return value of csetref(.T.)..........................: ", CSetRef( .T. )
|
||||
? " return value of addascii([A],1,1) call................: ", AddAscii( "A", 1, 1 )
|
||||
? " return value of addascii(cStr,1,1) call...............: ", AddAscii( cStr, 1, 1 )
|
||||
? " value of cStr is now...................................: ", cStr
|
||||
? " return value of addascii(@cStr,1,1) call..............: ", addascii( @cStr, 1, 1 )
|
||||
? " return value of addascii(@cStr,1,1) call..............: ", AddAscii( @cStr, 1, 1 )
|
||||
? " value of cStr is now...................................: ", cStr
|
||||
? " return value of addascii(@cStr,-1,1) call.............: ", addascii( @cStr, -1, 1 )
|
||||
? " return value of addascii(@cStr,-1,1) call.............: ", AddAscii( @cStr, -1, 1 )
|
||||
? " value of cStr is now...................................: ", cStr
|
||||
? " return value of csetref(.F.)..........................: ", csetref( .F. )
|
||||
? " return value of csetref(.F.)..........................: ", CSetRef( .F. )
|
||||
|
||||
// tests for the new 4th parameter
|
||||
?
|
||||
? "Carryover tests(new 4th parameter):"
|
||||
? " return value of addascii([AAAA],1,2,.T.) call('ABAA')....:", addascii( "AAAA", 1, 2, .T. )
|
||||
? " return value of addascii([AAAA],257,2,.T.) call('BBAA')..:", addascii( "AAAA", 257, 2, .T. )
|
||||
? " return value of addascii([AAAA],257,2,.F.) call('ABAA')..:", addascii( "AAAA", 257, 2, .F. )
|
||||
? " return value of addascii([AAAA],258,,.T.) call('AABC')...:", addascii( "AAAA", 258,, .T. )
|
||||
? " return value of addascii([ABBA],-257,3,.T.) call('AAAA').:", addascii( "ABBA", -257, 3, .T. )
|
||||
? " return value of addascii([AAAA],1,2,.T.) call('ABAA')....:", AddAscii( "AAAA", 1, 2, .T. )
|
||||
? " return value of addascii([AAAA],257,2,.T.) call('BBAA')..:", AddAscii( "AAAA", 257, 2, .T. )
|
||||
? " return value of addascii([AAAA],257,2,.F.) call('ABAA')..:", AddAscii( "AAAA", 257, 2, .F. )
|
||||
? " return value of addascii([AAAA],258,,.T.) call('AABC')...:", AddAscii( "AAAA", 258,, .T. )
|
||||
? " return value of addascii([ABBA],-257,3,.T.) call('AAAA').:", AddAscii( "ABBA", -257, 3, .T. )
|
||||
|
||||
? "End test of ADDASCII()"
|
||||
?
|
||||
|
||||
@@ -70,37 +70,37 @@ PROCEDURE Main()
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' afteratnum("..",cStr) should be "test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr ) + '"'
|
||||
? ' afteratnum("..",cStr,2) should be ".is...a...test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr, 2 ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' afteratnum("..",cStr,2,2) should be ".a...test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
?
|
||||
|
||||
// Tests with CSetAtMuPa(.T.)
|
||||
? " Multi-Pass tests"
|
||||
? " Setting csetatmupa() to .T."
|
||||
csetatmupa( .T. )
|
||||
CSetAtMupa( .T. )
|
||||
? ' afteratnum("..",cStr) should be "test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr ) + '"'
|
||||
? ' afteratnum("..",cStr,2) should be "This...is...a...test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr, 2 ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' afteratnum("..",cStr,2,2) should be "is...a...test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? " Setting csetatmupa() to .F."
|
||||
csetatmupa( .F. )
|
||||
CSetAtMupa( .F. )
|
||||
?
|
||||
|
||||
// Tests mit SetAtlike(1)
|
||||
? " SetAtLike tests"
|
||||
? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
setatlike( CT_SETATLIKE_WILDCARD, "." )
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, "." )
|
||||
? ' afteratnum("..",cStr) should be "",'
|
||||
? ' and is "' + afteratnum( "..", cStr ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr ) + '"'
|
||||
? ' afteratnum("..",cStr,2,2) should be "s...is...a...test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' afteratnum("..",cStr,2,10) should be ".a...test!",'
|
||||
? ' and is "' + afteratnum( "..", cStr, 2, 10 ) + '"'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 10 ) + '"'
|
||||
?
|
||||
|
||||
? "End test of AFTERATNUM()"
|
||||
|
||||
@@ -59,9 +59,9 @@ PROCEDURE Main()
|
||||
? "Begin test of ASCIISUM()"
|
||||
?
|
||||
|
||||
? ' asciisum(replicate("A", 10000)) == 650000 ? --> ' + Str( asciisum( Replicate( "A", 10000 ) ) )
|
||||
? ' asciisum("0123456789") == 525 ? --> ' + Str( asciisum( "0123456789" ) )
|
||||
? ' asciisum(NIL) == 0 ? --> ' + Str( asciisum( NIL ) )
|
||||
? ' asciisum(replicate("A", 10000)) == 650000 ? --> ' + Str( AsciiSum( Replicate( "A", 10000 ) ) )
|
||||
? ' asciisum("0123456789") == 525 ? --> ' + Str( AsciiSum( "0123456789" ) )
|
||||
? ' asciisum(NIL) == 0 ? --> ' + Str( AsciiSum( NIL ) )
|
||||
|
||||
?
|
||||
? "End test of ASCIISUM()"
|
||||
|
||||
@@ -59,9 +59,9 @@ PROCEDURE Main()
|
||||
? "Begin test of ASCPOS()"
|
||||
?
|
||||
|
||||
? ' ascpos("0123456789") == 57 ? --> ' + Str( ascpos( "0123456789" ) )
|
||||
? ' ascpos("0123456789",1) == 48 ? --> ' + Str( ascpos( "0123456789", 1 ) )
|
||||
? ' ascpos("0123456789",11) == 0 ? --> ' + Str( ascpos( "0123456789", 11 ) )
|
||||
? ' ascpos("0123456789") == 57 ? --> ' + Str( AscPos( "0123456789" ) )
|
||||
? ' ascpos("0123456789",1) == 48 ? --> ' + Str( AscPos( "0123456789", 1 ) )
|
||||
? ' ascpos("0123456789",11) == 0 ? --> ' + Str( AscPos( "0123456789", 11 ) )
|
||||
|
||||
?
|
||||
? "End test of ASCPOS()"
|
||||
|
||||
@@ -80,21 +80,21 @@ PROCEDURE Main()
|
||||
|
||||
? ' ATADJUST(":", aStr[ni], 21,,, ".") yields'
|
||||
FOR ni := 1 TO Len( aStr )
|
||||
? Space( 4 ) + atadjust( ":", aStr[ ni ], 21, 1,, "." )
|
||||
? Space( 4 ) + AtAdjust( ":", aStr[ ni ], 21, 1,, "." )
|
||||
NEXT
|
||||
?
|
||||
|
||||
? ' ATADJUST(":", aStr[ni], 10, 1,, ".") yields'
|
||||
FOR ni := 1 TO Len( aStr )
|
||||
? Space( 4 ) + atadjust( ":", aStr[ ni ], 10, 1,, "." )
|
||||
? Space( 4 ) + AtAdjust( ":", aStr[ ni ], 10, 1,, "." )
|
||||
NEXT
|
||||
?
|
||||
|
||||
? ' SETATLIKE(CT_SETATLIKE_WILDCARD, ":")'
|
||||
? ' ATADJUST(":", aStr[ni], 10, 1,, ".") yields now'
|
||||
setatlike( CT_SETATLIKE_WILDCARD, ":" )
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, ":" )
|
||||
FOR ni := 1 TO Len( aStr )
|
||||
? Space( 4 ) + atadjust( ":", aStr[ ni ], 10, 1,, "." )
|
||||
? Space( 4 ) + AtAdjust( ":", aStr[ ni ], 10, 1,, "." )
|
||||
NEXT
|
||||
?
|
||||
|
||||
|
||||
@@ -70,37 +70,37 @@ PROCEDURE Main()
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' atnum("..",cStr) should be 18,'
|
||||
? ' and is ', atnum( "..", cStr )
|
||||
? ' and is ', AtNum( "..", cStr )
|
||||
? ' atnum("..",cStr,2) should be 8,'
|
||||
? ' and is ', atnum( "..", cStr, 2 )
|
||||
? ' and is ', AtNum( "..", cStr, 2 )
|
||||
? ' atnum("..",cStr,2,2) should be 13,'
|
||||
? ' and is ', atnum( "..", cStr, 2, 2 )
|
||||
? ' and is ', AtNum( "..", cStr, 2, 2 )
|
||||
?
|
||||
|
||||
// Tests with CSetAtMuPa(.T.)
|
||||
? " Multi-Pass tests"
|
||||
? " Setting csetatmupa() to .T."
|
||||
csetatmupa( .T. )
|
||||
CSetAtMupa( .T. )
|
||||
? ' atnum("..",cStr) should be 18,'
|
||||
? ' and is ', atnum( "..", cStr )
|
||||
? ' and is ', AtNum( "..", cStr )
|
||||
? ' atnum("..",cStr,2) should be 2,'
|
||||
? ' and is ', atnum( "..", cStr, 2 )
|
||||
? ' and is ', AtNum( "..", cStr, 2 )
|
||||
? ' atnum("..",cStr,2,2) should be 9,'
|
||||
? ' and is ', atnum( "..", cStr, 2, 2 )
|
||||
? ' and is ', AtNum( "..", cStr, 2, 2 )
|
||||
? " Setting csetatmupa() to .F."
|
||||
csetatmupa( .F. )
|
||||
CSetAtMupa( .F. )
|
||||
?
|
||||
|
||||
// Tests mit SetAtlike(1)
|
||||
? " SetAtLike tests"
|
||||
? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
setatlike( CT_SETATLIKE_WILDCARD, "." )
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, "." )
|
||||
? ' atnum("..",cStr) should be 23,'
|
||||
? ' and is ', atnum( "..", cStr )
|
||||
? ' and is ', AtNum( "..", cStr )
|
||||
? ' atnum("..",cStr,2,2) should be 5,'
|
||||
? ' and is ', atnum( "..", cStr, 2, 2 )
|
||||
? ' and is ', AtNum( "..", cStr, 2, 2 )
|
||||
? ' atnum("..",cStr,2,10) should be 13,'
|
||||
? ' and is ', atnum( "..", cStr, 2, 10 )
|
||||
? ' and is ', AtNum( "..", cStr, 2, 10 )
|
||||
?
|
||||
|
||||
? "End test of ATNUM()"
|
||||
|
||||
@@ -62,12 +62,12 @@ PROCEDURE Main()
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
|
||||
? ' atrepl("ABC", "ABCDABCDABC", "xx") == "xxDxxDxx" ? --> "' + atrepl( "ABC", "ABCDABCDABC", "xx" ) + '"'
|
||||
? ' atrepl("ABC", "ABCDABC", "ZYXW") == "ZYXWDZYXW" ? --> "' + atrepl( "ABC", "ABCDABC", "ZYXW" ) + '"'
|
||||
? ' 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") == "xxDxxDxx" ? --> "' + AtRepl( "ABC", "ABCDABCDABC", "xx" ) + '"'
|
||||
? ' atrepl("ABC", "ABCDABC", "ZYXW") == "ZYXWDZYXW" ? --> "' + AtRepl( "ABC", "ABCDABC", "ZYXW" ) + '"'
|
||||
? ' 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()"
|
||||
?
|
||||
|
||||
@@ -68,18 +68,18 @@ PROCEDURE Main()
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' attoken("Hello, World!") == 8 ? ---------> ' + Str( attoken( "Hello, World!" ) )
|
||||
? ' attoken("Hello, World!",,2) == 8 ? ------> ' + Str( attoken( "Hello, World!",, 2 ) )
|
||||
? ' attoken("Hello, World!",,2,1) == 7 ? ----> ' + Str( attoken( "Hello, World!",, 2, 1 ) )
|
||||
? ' attoken("Hello, World!"," ",2,1) == 8 ? -> ' + Str( attoken( "Hello, World!", " ", 2, 1 ) )
|
||||
? ' attoken("Hello, World!") == 8 ? ---------> ' + Str( AtToken( "Hello, World!" ) )
|
||||
? ' attoken("Hello, World!",,2) == 8 ? ------> ' + Str( AtToken( "Hello, World!",, 2 ) )
|
||||
? ' attoken("Hello, World!",,2,1) == 7 ? ----> ' + Str( AtToken( "Hello, World!",, 2, 1 ) )
|
||||
? ' attoken("Hello, World!"," ",2,1) == 8 ? -> ' + Str( AtToken( "Hello, World!", " ", 2, 1 ) )
|
||||
?
|
||||
|
||||
? ' Tokenizing a string with skip width == 1 and ".!" as tokenizer list:'
|
||||
? " Value of cStr is:" + Chr( 34 ) + cStr + Chr( 34 )
|
||||
?
|
||||
FOR ni := 1 TO numtoken( cStr, ".!", 1 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".!", ni, 1 ) + '")'
|
||||
? " starts at pos " + Str( npos := attoken( cStr, ".!", ni, 1 ), 3 ) + ;
|
||||
FOR ni := 1 TO NumToken( cStr, ".!", 1 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".!", ni, 1 ) + '")'
|
||||
? " starts at pos " + Str( npos := AtToken( cStr, ".!", ni, 1 ), 3 ) + ;
|
||||
" and is " + iif( SubStr( cStr, npos, 1 ) $ ".!", "", "not " ) + "an empty token."
|
||||
NEXT
|
||||
|
||||
|
||||
@@ -70,37 +70,37 @@ PROCEDURE Main()
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' beforatnum("..",cStr) should be "...This...is...a.",'
|
||||
? ' and is "' + beforatnum( "..", cStr ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr ) + '"'
|
||||
? ' beforatnum("..",cStr,2) should be "...This",'
|
||||
? ' and is "' + beforatnum( "..", cStr, 2 ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' beforatnum("..",cStr,2,2) should be "...This...is",'
|
||||
? ' and is "' + beforatnum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
?
|
||||
|
||||
// Tests with CSetAtMuPa(.T.)
|
||||
? " Multi-Pass tests"
|
||||
? " Setting csetatmupa() to .T."
|
||||
csetatmupa( .T. )
|
||||
CSetAtMupa( .T. )
|
||||
? ' beforatnum("..",cStr) should be "...This...is...a.",'
|
||||
? ' and is "' + beforatnum( "..", cStr ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr ) + '"'
|
||||
? ' beforatnum("..",cStr,2) should be ".",'
|
||||
? ' and is "' + beforatnum( "..", cStr, 2 ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' beforatnum("..",cStr,2,2) should be "...This.",'
|
||||
? ' and is "' + beforatnum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? " Setting csetatmupa() to .F."
|
||||
csetatmupa( .F. )
|
||||
CSetAtMupa( .F. )
|
||||
?
|
||||
|
||||
// Tests mit SetAtlike(1)
|
||||
? " SetAtLike tests"
|
||||
? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
setatlike( CT_SETATLIKE_WILDCARD, "." )
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, "." )
|
||||
? ' beforatnum("..",cStr) should be "...This...is...a...tes",'
|
||||
? ' and is "' + beforatnum( "..", cStr ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr ) + '"'
|
||||
? ' beforatnum("..",cStr,2,2) should be "...T",'
|
||||
? ' and is "' + beforatnum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' beforatnum("..",cStr,2,10) should be "...This...is",'
|
||||
? ' and is "' + beforatnum( "..", cStr, 2, 10 ) + '"'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 10 ) + '"'
|
||||
?
|
||||
|
||||
? "End test of BEFORATNUM()"
|
||||
|
||||
@@ -61,10 +61,10 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charadd("012345678", chr(1)) == "123456789" ? -> "' + charadd( "012345678", Chr( 1 ) ) + '"'
|
||||
? ' charadd("012345678", chr(1)+chr(2)) == "133557799" ? -> "' + charadd( "012345678", Chr( 1 ) + Chr( 2 ) ) + '"'
|
||||
? ' charadd("123456789", chr(255)) == "012345678" ? -> "' + charadd( "123456789", Chr( 255 ) ) + '"'
|
||||
? ' charadd("123456789", chr(255)+chr(254)) == "002244668" ? -> "' + charadd( "123456789", Chr( 255 ) + Chr( 254 ) ) + '"'
|
||||
? ' charadd("012345678", chr(1)) == "123456789" ? -> "' + CharAdd( "012345678", Chr( 1 ) ) + '"'
|
||||
? ' charadd("012345678", chr(1)+chr(2)) == "133557799" ? -> "' + CharAdd( "012345678", Chr( 1 ) + Chr( 2 ) ) + '"'
|
||||
? ' charadd("123456789", chr(255)) == "012345678" ? -> "' + CharAdd( "123456789", Chr( 255 ) ) + '"'
|
||||
? ' charadd("123456789", chr(255)+chr(254)) == "002244668" ? -> "' + CharAdd( "123456789", Chr( 255 ) + Chr( 254 ) ) + '"'
|
||||
|
||||
? "End test of CHARADD()"
|
||||
?
|
||||
|
||||
@@ -62,8 +62,8 @@ PROCEDURE Main()
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
|
||||
? ' charand("012345678", chr(254)) == "002244668" ? --> "' + charand( "012345678", Chr( 254 ) ) + '"'
|
||||
? ' charand("012345678", chr(254)+chr(252)) == "002044648" ? --> "' + charand( "012345678", Chr( 254 ) + Chr( 252 ) ) + '"'
|
||||
? ' charand("012345678", chr(254)) == "002244668" ? --> "' + CharAnd( "012345678", Chr( 254 ) ) + '"'
|
||||
? ' charand("012345678", chr(254)+chr(252)) == "002044648" ? --> "' + CharAnd( "012345678", Chr( 254 ) + Chr( 252 ) ) + '"'
|
||||
|
||||
? "End test of CHARAND()"
|
||||
?
|
||||
|
||||
@@ -61,9 +61,9 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' chareven(" 1 2 3 4 5") == "12345" ? --> "' + chareven( " 1 2 3 4 5" ) + '"'
|
||||
? ' chareven(" 1 2 3 4 ") == "1234" ? --> "' + chareven( " 1 2 3 4 " ) + '"'
|
||||
? ' chareven(" ") == "" ? --> "' + chareven( " " ) + '"'
|
||||
? ' chareven(" 1 2 3 4 5") == "12345" ? --> "' + CharEven( " 1 2 3 4 5" ) + '"'
|
||||
? ' chareven(" 1 2 3 4 ") == "1234" ? --> "' + CharEven( " 1 2 3 4 " ) + '"'
|
||||
? ' chareven(" ") == "" ? --> "' + CharEven( " " ) + '"'
|
||||
|
||||
? "End test of CHAREVEN()"
|
||||
?
|
||||
|
||||
@@ -63,9 +63,9 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charhist("Hello World !")' + "'109' == 3 ? --> ", charhist( "Hello World !" )' 109 '
|
||||
? ' charhist("Hello World !")' + "'109' == 3 ? --> ", CharHist( "Hello World !" )' 109 '
|
||||
? ' aeval(charhist("Hello World !"), {| x | nTotal += x } ) '
|
||||
AEval( charhist( "Hello World !" ), {| x | nTotal += x } )
|
||||
AEval( CharHist( "Hello World !" ), {| x | nTotal += x } )
|
||||
? ' ==> nTotal == len("Hello World !") ? --> ', nTotal == Len( "Hello World !" )
|
||||
|
||||
? "End test of CHARHIST()"
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charlist("Hello World !") == "Helo Wrd!" ? -> "' + charlist( "Hello World !" ) + '"'
|
||||
? ' charlist(NIL) == "" ? -> "' + charlist( NIL ) + '"'
|
||||
? ' charlist("Hello World !") == "Helo Wrd!" ? -> "' + CharList( "Hello World !" ) + '"'
|
||||
? ' charlist(NIL) == "" ? -> "' + CharList( NIL ) + '"'
|
||||
|
||||
? "End test of CHARLIST()"
|
||||
?
|
||||
|
||||
@@ -61,9 +61,9 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charmirr("racecar") == "racecar" ? ----------> "' + charmirr( "racecar" ) + '"'
|
||||
? ' charmirr("racecar ", .T.) == "racecar " ? -> "' + charmirr( "racecar ", .T. ) + '"'
|
||||
? ' charmirr("racecar ", .F.) == " racecar" ? -> "' + charmirr( "racecar ", .F. ) + '"'
|
||||
? ' charmirr("racecar") == "racecar" ? ----------> "' + CharMirr( "racecar" ) + '"'
|
||||
? ' charmirr("racecar ", .T.) == "racecar " ? -> "' + CharMirr( "racecar ", .T. ) + '"'
|
||||
? ' charmirr("racecar ", .F.) == " racecar" ? -> "' + CharMirr( "racecar ", .F. ) + '"'
|
||||
|
||||
? "End test of CHARMIRR()"
|
||||
?
|
||||
|
||||
@@ -61,11 +61,11 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charmix("ABC", "123") == "A1B2C3" ? --> "' + charmix( "ABC", "123" ) + '"'
|
||||
? ' charmix("ABCDE", "12") == "A1B2C1D2E1" ? --> "' + charmix( "ABCDE", "12" ) + '"'
|
||||
? ' charmix("AB", "12345") == "A1B2" ? --> "' + charmix( "AB", "12345" ) + '"'
|
||||
? ' charmix("HELLO", " ") == "H E L L O " ? --> "' + charmix( "HELLO", " " ) + '"'
|
||||
? ' charmix("HELLO", "") == "HELLO" ? --> "' + charmix( "HELLO", "" ) + '"'
|
||||
? ' charmix("ABC", "123") == "A1B2C3" ? --> "' + CharMix( "ABC", "123" ) + '"'
|
||||
? ' charmix("ABCDE", "12") == "A1B2C1D2E1" ? --> "' + CharMix( "ABCDE", "12" ) + '"'
|
||||
? ' charmix("AB", "12345") == "A1B2" ? --> "' + CharMix( "AB", "12345" ) + '"'
|
||||
? ' charmix("HELLO", " ") == "H E L L O " ? --> "' + CharMix( "HELLO", " " ) + '"'
|
||||
? ' charmix("HELLO", "") == "HELLO" ? --> "' + CharMix( "HELLO", "" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARMIX()"
|
||||
|
||||
@@ -62,8 +62,8 @@ PROCEDURE Main()
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
|
||||
? ' charnolist(charnolist("Hello World !")) == " !HWdelor" ? -> "' + charnolist( charnolist( "Hello World !" ) ) + '"'
|
||||
? ' charnolist(charnolist(NIL)) == "" ? -> "' + charnolist( charnolist( NIL ) ) + '"'
|
||||
? ' charnolist(charnolist("Hello World !")) == " !HWdelor" ? -> "' + CharNoList( CharNoList( "Hello World !" ) ) + '"'
|
||||
? ' charnolist(charnolist(NIL)) == "" ? -> "' + CharNoList( CharNoList( NIL ) ) + '"'
|
||||
|
||||
? "End test of CHARNOLIST()"
|
||||
?
|
||||
|
||||
@@ -72,7 +72,7 @@ PROCEDURE Main()
|
||||
? ' chr(170)+chr(127)+chr(85)+chr(254) ? -->'
|
||||
|
||||
? ' '
|
||||
cStr := charnot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) )
|
||||
cStr := CharNot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
@@ -82,7 +82,7 @@ PROCEDURE Main()
|
||||
?
|
||||
|
||||
? ' charnot(charnot("This is a test!")) == "This is a test!" ?'
|
||||
? ' --> "' + charnot( charnot( "This is a test!" ) ) + '"'
|
||||
? ' --> "' + CharNot( CharNot( "This is a test!" ) ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARNOT()"
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charodd("1A2B3C4D5E") == "12345" ? --> "' + charodd( "1A2B3C4D5E" ) + '"'
|
||||
? ' charodd("1A2B3C4D5") == "12345" ? --> "' + charodd( "1A2B3C4D5" ) + '"'
|
||||
? ' charodd("1A2B3C4D5E") == "12345" ? --> "' + CharOdd( "1A2B3C4D5E" ) + '"'
|
||||
? ' charodd("1A2B3C4D5") == "12345" ? --> "' + CharOdd( "1A2B3C4D5" ) + '"'
|
||||
|
||||
? "End test of CHARODD()"
|
||||
?
|
||||
|
||||
@@ -61,11 +61,11 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charone("112333a123") == "123a123"? --> "' + charone( "112333a123" ) + '"'
|
||||
? ' charone("122333a123") == "123a123"? --> "' + charone( "122333a123" ) + '"'
|
||||
? ' charone("A B CCCD") == "A B CD"? ---> "' + charone( "A B CCCD" ) + '"'
|
||||
? ' charone(" ", "A B A B") == "A B A B"? --> "' + charone( " ", "A B A B" ) + '"'
|
||||
? ' charone("o", "122oooB12o") == "122oB12o"? -> "' + charone( "o", "122oooB12o" ) + '"'
|
||||
? ' charone("112333a123") == "123a123"? --> "' + CharOne( "112333a123" ) + '"'
|
||||
? ' charone("122333a123") == "123a123"? --> "' + CharOne( "122333a123" ) + '"'
|
||||
? ' charone("A B CCCD") == "A B CD"? ---> "' + CharOne( "A B CCCD" ) + '"'
|
||||
? ' charone(" ", "A B A B") == "A B A B"? --> "' + CharOne( " ", "A B A B" ) + '"'
|
||||
? ' charone("o", "122oooB12o") == "122oB12o"? -> "' + CharOne( "o", "122oooB12o" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARONE()"
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charonly("0123456789", "0211 - 38 99 77") == "0211389977" ? --> "' + charonly( "0123456789", "0211 - 38 99 77" ) + '"'
|
||||
? ' charonly("0123456789", "0211/ 389 977") == "0211389977" ? --> "' + charonly( "0123456789", "0211/ 389 977" ) + '"'
|
||||
? ' charonly("0123456789", "0211 - 38 99 77") == "0211389977" ? --> "' + CharOnly( "0123456789", "0211 - 38 99 77" ) + '"'
|
||||
? ' charonly("0123456789", "0211/ 389 977") == "0211389977" ? --> "' + CharOnly( "0123456789", "0211/ 389 977" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARONLY()"
|
||||
|
||||
@@ -62,8 +62,8 @@ PROCEDURE Main()
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
|
||||
? ' charor("012345678", chr(1)) == "113355779" ? --> "' + charor( "012345678", Chr( 1 ) ) + '"'
|
||||
? ' charor("012345678", chr(1)+chr(3)) == "133357779" ? --> "' + charor( "012345678", Chr( 1 ) + Chr( 3 ) ) + '"'
|
||||
? ' charor("012345678", chr(1)) == "113355779" ? --> "' + CharOr( "012345678", Chr( 1 ) ) + '"'
|
||||
? ' charor("012345678", chr(1)+chr(3)) == "133357779" ? --> "' + CharOr( "012345678", Chr( 1 ) + Chr( 3 ) ) + '"'
|
||||
|
||||
? "End test of CHAROR()"
|
||||
?
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charrem(" ", " 1 2 ") == "12" ? ---> "' + charrem( " ", " 1 2 " ) + '"'
|
||||
? ' charrem("3y", "xyz123") == "xz12" ? ---> "' + charrem( "3y", "xyz123" ) + '"'
|
||||
? ' charrem(" ", " 1 2 ") == "12" ? ---> "' + CharRem( " ", " 1 2 " ) + '"'
|
||||
? ' charrem("3y", "xyz123") == "xz12" ? ---> "' + CharRem( "3y", "xyz123" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARREM()"
|
||||
|
||||
@@ -61,11 +61,11 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charrepl("1234", "1x2y3z", "abcd") == "axbycz" ? --> "' + charrepl( "1234", "1x2y3z", "abcd" ) + '"'
|
||||
? ' charrepl("abcdefghij", "jhfdb", "1234567890") == "08642" ? --> "' + charrepl( "abcdefghij", "jhfdb", "1234567890" ) + '"'
|
||||
? ' charrepl("abcdefghij", "jhfdb", "12345") == "55542" ? --> "' + charrepl( "abcdefghij", "jhfdb", "12345" ) + '"'
|
||||
? ' charrepl("1234", "1234", "234A") == "AAAA" ? --> "' + charrepl( "1234", "1234", "234A" ) + '"'
|
||||
? ' charrepl("1234", "1234", "234A", .T.) == "234A" ? --> "' + charrepl( "1234", "1234", "234A", .T. ) + '"'
|
||||
? ' charrepl("1234", "1x2y3z", "abcd") == "axbycz" ? --> "' + CharRepl( "1234", "1x2y3z", "abcd" ) + '"'
|
||||
? ' charrepl("abcdefghij", "jhfdb", "1234567890") == "08642" ? --> "' + CharRepl( "abcdefghij", "jhfdb", "1234567890" ) + '"'
|
||||
? ' charrepl("abcdefghij", "jhfdb", "12345") == "55542" ? --> "' + CharRepl( "abcdefghij", "jhfdb", "12345" ) + '"'
|
||||
? ' charrepl("1234", "1234", "234A") == "AAAA" ? --> "' + CharRepl( "1234", "1234", "234A" ) + '"'
|
||||
? ' charrepl("1234", "1234", "234A", .T.) == "234A" ? --> "' + CharRepl( "1234", "1234", "234A", .T. ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARREPL()"
|
||||
|
||||
@@ -72,7 +72,7 @@ PROCEDURE Main()
|
||||
? ' chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4) ? -->'
|
||||
|
||||
? ' '
|
||||
cStr := charrll( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
cStr := CharRll( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
|
||||
@@ -72,7 +72,7 @@ PROCEDURE Main()
|
||||
? ' chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->'
|
||||
|
||||
? ' '
|
||||
cStr := charrlr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
cStr := CharRlr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
|
||||
@@ -72,7 +72,7 @@ PROCEDURE Main()
|
||||
? ' chr(0)+chr(0)+chr(0)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->'
|
||||
|
||||
? ' '
|
||||
cStr := charshr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
cStr := CharShr( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charslist("Hello World !") == " !HWdelor" ? -> "' + charslist( "Hello World !" ) + '"'
|
||||
? ' charslist(NIL) == "" ? -> "' + charslist( NIL ) + '"'
|
||||
? ' charslist("Hello World !") == " !HWdelor" ? -> "' + CharSList( "Hello World !" ) + '"'
|
||||
? ' charslist(NIL) == "" ? -> "' + CharSList( NIL ) + '"'
|
||||
|
||||
? "End test of CHARSLIST()"
|
||||
?
|
||||
|
||||
@@ -61,15 +61,15 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charsort("qwert") == "eqrtw" ? --> "' + charsort( "qwert" ) + '"'
|
||||
? ' charsort("qwert", 2) == "erqwt" ? --> "' + charsort( "qwert", 2 ) + '"'
|
||||
? ' charsort("b1a4a3a2a1", 2, 1) == "a2a1a3a4b1" ? --> "' + charsort( "b1a4a3a2a1", 2, 1 ) + '"'
|
||||
? ' charsort("qwert") == "eqrtw" ? --> "' + CharSort( "qwert" ) + '"'
|
||||
? ' charsort("qwert", 2) == "erqwt" ? --> "' + CharSort( "qwert", 2 ) + '"'
|
||||
? ' charsort("b1a4a3a2a1", 2, 1) == "a2a1a3a4b1" ? --> "' + CharSort( "b1a4a3a2a1", 2, 1 ) + '"'
|
||||
? ' NOTE : The order of equal elements(here the one beginning with the same char) is NOT determined !'
|
||||
? ' charsort("XXXqwert", 1, 1, 3) == "XXXeqrtw" ? --> "' + charsort( "XXXqwert", 1, 1, 3 ) + '"'
|
||||
? ' charsort("b1a4a3a2a1", 2, 1, 0, 1) == "a1b1a2a3a4" ? --> "' + charsort( "b1a4a3a2a1", 2, 1, 0, 1 ) + '"'
|
||||
? ' charsort("XXXqwert", 1, 1, 3) == "XXXeqrtw" ? --> "' + CharSort( "XXXqwert", 1, 1, 3 ) + '"'
|
||||
? ' charsort("b1a4a3a2a1", 2, 1, 0, 1) == "a1b1a2a3a4" ? --> "' + CharSort( "b1a4a3a2a1", 2, 1, 0, 1 ) + '"'
|
||||
? ' NOTE : The order of equal elements(here the one ending with the same number) is NOT determined !'
|
||||
? ' charsort("384172852", 1, 1, 0, 0, 4) == "134872852" ? --> "' + charsort( "384172852", 1, 1, 0, 0, 4 ) + '"'
|
||||
? ' charsort("qwert",,,,,,.T.) == "wtrqe" ? --> "' + charsort( "qwert",,,,,, .T. ) + '"'
|
||||
? ' charsort("384172852", 1, 1, 0, 0, 4) == "134872852" ? --> "' + CharSort( "384172852", 1, 1, 0, 0, 4 ) + '"'
|
||||
? ' charsort("qwert",,,,,,.T.) == "wtrqe" ? --> "' + CharSort( "qwert",,,,,, .T. ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARSORT()"
|
||||
|
||||
@@ -61,10 +61,10 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charadd("123456789", chr(1)) == "012345678" ? -> "' + charsub( "123456789", Chr( 1 ) ) + '"'
|
||||
? ' charadd("123456789", chr(1)+chr(2)) == "002244668" ? -> "' + charsub( "123456789", Chr( 1 ) + Chr( 2 ) ) + '"'
|
||||
? ' charadd("012345678", chr(255)) == "123456789" ? -> "' + charsub( "012345678", Chr( 255 ) ) + '"'
|
||||
? ' charadd("012345678", chr(255)+Chr(254)) == "133557799" ? -> "' + charsub( "012345678", Chr( 255 ) + Chr( 254 ) ) + '"'
|
||||
? ' charadd("123456789", chr(1)) == "012345678" ? -> "' + CharSub( "123456789", Chr( 1 ) ) + '"'
|
||||
? ' charadd("123456789", chr(1)+chr(2)) == "002244668" ? -> "' + CharSub( "123456789", Chr( 1 ) + Chr( 2 ) ) + '"'
|
||||
? ' charadd("012345678", chr(255)) == "123456789" ? -> "' + CharSub( "012345678", Chr( 255 ) ) + '"'
|
||||
? ' charadd("012345678", chr(255)+Chr(254)) == "133557799" ? -> "' + CharSub( "012345678", Chr( 255 ) + Chr( 254 ) ) + '"'
|
||||
|
||||
? "End test of CHARSUB()"
|
||||
?
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charswap("0123456789") == "1032547698" ? --> "' + charswap( "0123456789" ) + '"'
|
||||
? ' charswap("ABCDEFGHIJK") == "BADCFEHGJIK" ? --> "' + charswap( "ABCDEFGHIJK" ) + '"'
|
||||
? ' charswap("0123456789") == "1032547698" ? --> "' + CharSwap( "0123456789" ) + '"'
|
||||
? ' charswap("ABCDEFGHIJK") == "BADCFEHGJIK" ? --> "' + CharSwap( "ABCDEFGHIJK" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARSWAP()"
|
||||
|
||||
@@ -63,7 +63,7 @@ PROCEDURE Main()
|
||||
? "Simple tests:"
|
||||
? ' charxor(charxor("This is top secret !", "My Password"),'
|
||||
? ' "My Password") == "This is top secret !" ? ->'
|
||||
? ' ' + charxor( charxor( "This is top secret !", "My Password" ), "My Password" )
|
||||
? ' ' + CharXor( CharXor( "This is top secret !", "My Password" ), "My Password" )
|
||||
|
||||
? "End test of CHARXOR()"
|
||||
?
|
||||
|
||||
@@ -78,11 +78,11 @@ PROCEDURE Main()
|
||||
?
|
||||
? "Standard behaviour"
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
cRet := addascii( 5789676, 1, 2, .T. )
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -90,13 +90,13 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_WHOCARES on argument error
|
||||
?
|
||||
? "CT_ARGERR_WHOCARES behaviour"
|
||||
CSETARGERR( CT_ARGERR_WHOCARES )
|
||||
CSetArgErr( CT_ARGERR_WHOCARES )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
cRet := addascii( 5789676, 1, 2, .T. )
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -104,13 +104,13 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_WARNING on argument error
|
||||
?
|
||||
? "CT_ARGERR_WARNING behaviour"
|
||||
CSETARGERR( CT_ARGERR_WARNING )
|
||||
CSetArgErr( CT_ARGERR_WARNING )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
cRet := addascii( 5789676, 1, 2, .T. )
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -118,13 +118,13 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_ERROR on argument error
|
||||
?
|
||||
? "CT_ARGERR_ERROR behaviour"
|
||||
CSETARGERR( CT_ARGERR_ERROR )
|
||||
CSetArgErr( CT_ARGERR_ERROR )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
cRet := addascii( 5789676, 1, 2, .T. )
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -132,13 +132,13 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_CATASTROPHIC on argument error
|
||||
?
|
||||
? "CT_ARGERR_CATASTROPHIC behaviour"
|
||||
CSETARGERR( CT_ARGERR_CATASTROPHIC )
|
||||
CSetArgErr( CT_ARGERR_CATASTROPHIC )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
cRet := addascii( 5789676, 1, 2, .T. )
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -151,7 +151,7 @@ PROCEDURE Main()
|
||||
?
|
||||
? "Standard behaviour"
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -159,9 +159,9 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_WHOCARES on argument error
|
||||
?
|
||||
? "CT_ARGERR_WHOCARES behaviour"
|
||||
CSETARGERR( CT_ARGERR_WHOCARES )
|
||||
CSetArgErr( CT_ARGERR_WHOCARES )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -169,9 +169,9 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_WARNING on argument error
|
||||
?
|
||||
? "CT_ARGERR_WARNING behaviour"
|
||||
CSETARGERR( CT_ARGERR_WARNING )
|
||||
CSetArgErr( CT_ARGERR_WARNING )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -179,9 +179,9 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_ERROR on argument error
|
||||
?
|
||||
? "CT_ARGERR_ERROR behaviour"
|
||||
CSETARGERR( CT_ARGERR_ERROR )
|
||||
CSetArgErr( CT_ARGERR_ERROR )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
@@ -189,9 +189,9 @@ PROCEDURE Main()
|
||||
// CT_ARGERR_CATASTROPHIC on argument error
|
||||
?
|
||||
? "CT_ARGERR_CATASTROPHIC behaviour"
|
||||
CSETARGERR( CT_ARGERR_CATASTROPHIC )
|
||||
CSetArgErr( CT_ARGERR_CATASTROPHIC )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
cRet := charadd( "AA", .F. )
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
|
||||
@@ -57,10 +57,10 @@ PROCEDURE Main()
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CSETATMUPA()"
|
||||
? " Default switch should be .F., is..................................", csetatmupa()
|
||||
? " Setting switch to .T., return value should be .F., is.............", csetatmupa( .T. )
|
||||
? " Switch setting should now be .T., is..............................", csetatmupa()
|
||||
? " Setting switch to .F. again, return value should still be .T., is ", csetatmupa( .F. )
|
||||
? " Default switch should be .F., is..................................", CSetAtMupa()
|
||||
? " Setting switch to .T., return value should be .F., is.............", CSetAtMupa( .T. )
|
||||
? " Switch setting should now be .T., is..............................", CSetAtMupa()
|
||||
? " Setting switch to .F. again, return value should still be .T., is ", CSetAtMupa( .F. )
|
||||
? "End test of CSETATMUPA()"
|
||||
?
|
||||
|
||||
|
||||
@@ -57,10 +57,10 @@ PROCEDURE Main()
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CSETREF()"
|
||||
? " Default switch should be .F., is..................................", csetref()
|
||||
? " Setting switch to .T., return value should be .F., is.............", csetref( .T. )
|
||||
? " Switch setting should now be .T., is..............................", csetref()
|
||||
? " Setting switch to .F. again, return value should still be .T., is ", csetref( .F. )
|
||||
? " Default switch should be .F., is..................................", CSetRef()
|
||||
? " Setting switch to .T., return value should be .F., is.............", CSetRef( .T. )
|
||||
? " Switch setting should now be .T., is..............................", CSetRef()
|
||||
? " Setting switch to .F. again, return value should still be .T., is ", CSetRef( .F. )
|
||||
? "End test of CSETREF()"
|
||||
?
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ PROCEDURE Main()
|
||||
LOCAL aWin := Array( 9 ), y, x, i, k, lFlag := .F., lBoard := .T.
|
||||
|
||||
SetBlink( .F. )
|
||||
wboard( 5, 5, 20, 75 )
|
||||
wmode( .T., .T., .T., .T. )
|
||||
wsetshadow( 7 )
|
||||
setclearA( 10 * 16 + 14 )
|
||||
setclearB( 35 )
|
||||
DispBox( 0, 0, MaxRow(), MaxCol(), Replicate( "#", 9 ), ntocolor( 10 * 16 + 14 ) )
|
||||
WBoard( 5, 5, 20, 75 )
|
||||
WMode( .T., .T., .T., .T. )
|
||||
WSetShadow( 7 )
|
||||
SetClearA( 10 * 16 + 14 )
|
||||
SetClearB( 35 )
|
||||
DispBox( 0, 0, MaxRow(), MaxCol(), Replicate( "#", 9 ), NToColor( 10 * 16 + 14 ) )
|
||||
SetPos( 0, 0 )
|
||||
? "GT driver: " + hb_gtVersion()
|
||||
? hb_gtVersion( 1 )
|
||||
@@ -39,22 +39,22 @@ PROCEDURE Main()
|
||||
? "DEL - hide cursor "
|
||||
? "arrows - window move "
|
||||
|
||||
setclearB( 61 )
|
||||
SetClearB( 61 )
|
||||
FOR i := 1 TO Len( aWin )
|
||||
y := i + 2
|
||||
x := i * 4 + 10
|
||||
SetColor( ntocolor( i * 16 + 15 ) + ",W+/B*" )
|
||||
wsetshadow( i % 8 )
|
||||
aWin[ i ] := wopen( y, x, y + 10, x + 20 )
|
||||
wbox()
|
||||
SetColor( NToColor( i * 16 + 15 ) + ",W+/B*" )
|
||||
WSetShadow( i % 8 )
|
||||
aWin[ i ] := WOpen( y, x, y + 10, x + 20 )
|
||||
WBox()
|
||||
|
||||
@ -1, 0 SAY "TITLE " + hb_ntos( aWin[ i ] )
|
||||
? hb_ntos( Row() ) + ":" + hb_ntos( Col() ), "/", hb_ntos( MaxRow() ) + ":" + hb_ntos( MaxCol() ), ""
|
||||
? hb_ntos( wrow() ) + ":" + hb_ntos( wcol() ), "/", hb_ntos( MaxRow( .T. ) ) + ":" + hb_ntos( MaxCol( .T. ) ), ""
|
||||
? hb_ntos( wfrow() ) + ":" + hb_ntos( wfcol() ), "/", ;
|
||||
hb_ntos( wflastrow() ) + ":" + hb_ntos( wflastcol() ), ""
|
||||
? hb_ntos( wfrow( .T. ) ) + ":" + hb_ntos( wfcol( .T. ) ), "/", ;
|
||||
hb_ntos( wflastrow( .T. ) ) + ":" + hb_ntos( wflastcol( .T. ) ), ""
|
||||
? hb_ntos( WRow() ) + ":" + hb_ntos( WCol() ), "/", hb_ntos( MaxRow( .T. ) ) + ":" + hb_ntos( MaxCol( .T. ) ), ""
|
||||
? hb_ntos( WFRow() ) + ":" + hb_ntos( WFCol() ), "/", ;
|
||||
hb_ntos( WFLastRow() ) + ":" + hb_ntos( WFLastCol() ), ""
|
||||
? hb_ntos( WFRow( .T. ) ) + ":" + hb_ntos( WFCol( .T. ) ), "/", ;
|
||||
hb_ntos( WFLastRow( .T. ) ) + ":" + hb_ntos( WFLastCol( .T. ) ), ""
|
||||
? "window:", hb_ntos( aWin[ i ] ), ""
|
||||
SetCursor( Int( i % 5 ) )
|
||||
|
||||
@@ -66,40 +66,40 @@ PROCEDURE Main()
|
||||
IF k == K_ESC
|
||||
EXIT
|
||||
ELSEIF k >= hb_keyCode( "1" ) .AND. k <= hb_keyCode( "9" )
|
||||
wselect( aWin[ k - hb_keyCode( "0" ) ] )
|
||||
WSelect( aWin[ k - hb_keyCode( "0" ) ] )
|
||||
ELSEIF k == hb_keyCode( "0" )
|
||||
wselect( 0 )
|
||||
WSelect( 0 )
|
||||
ELSEIF k == hb_keyCode( "C" ) .OR. k == hb_keyCode( "c" )
|
||||
wclose()
|
||||
WClose()
|
||||
ELSEIF k == hb_keyCode( "Q" ) .OR. k == hb_keyCode( "q" )
|
||||
CLS
|
||||
ELSEIF k == hb_keyCode( "B" ) .OR. k == hb_keyCode( "b" )
|
||||
IF lBoard
|
||||
wboard( 0, 0, MaxRow( .T. ) - 1, MaxCol( .T. ) )
|
||||
WBoard( 0, 0, MaxRow( .T. ) - 1, MaxCol( .T. ) )
|
||||
ELSE
|
||||
wboard( 5, 5, 20, 75 )
|
||||
WBoard( 5, 5, 20, 75 )
|
||||
ENDIF
|
||||
lBoard := ! lBoard
|
||||
ELSEIF k == hb_keyCode( "P" ) .OR. k == hb_keyCode( "P" )
|
||||
y := wfrow()
|
||||
x := wfcol()
|
||||
i := wselect()
|
||||
wselect( 0 )
|
||||
y := WFRow()
|
||||
x := WFCol()
|
||||
i := WSelect()
|
||||
WSelect( 0 )
|
||||
@ y, x SAY "THIS IS WINDOW 0 OUTPUT"
|
||||
wselect( i )
|
||||
WSelect( i )
|
||||
ELSEIF k == K_INS
|
||||
lFlag := ! lFlag
|
||||
SetCursor( iif( lFlag, 3, 1 ) )
|
||||
ELSEIF k == K_DEL
|
||||
SetCursor( SC_NONE )
|
||||
ELSEIF k == K_LEFT
|
||||
wmove( wrow(), wcol() - 1 )
|
||||
WMove( WRow(), WCol() - 1 )
|
||||
ELSEIF k == K_RIGHT
|
||||
wmove( wrow(), wcol() + 1 )
|
||||
WMove( WRow(), WCol() + 1 )
|
||||
ELSEIF k == K_UP
|
||||
wmove( wrow() - 1, wcol() )
|
||||
WMove( WRow() - 1, WCol() )
|
||||
ELSEIF k == K_DOWN
|
||||
wmove( wrow() + 1, wcol() )
|
||||
WMove( WRow() + 1, WCol() )
|
||||
ENDIF
|
||||
dspcord()
|
||||
ENDDO
|
||||
@@ -108,11 +108,11 @@ PROCEDURE Main()
|
||||
|
||||
STATIC PROCEDURE dspcord()
|
||||
|
||||
LOCAL mr := MRow(), mc := MCol(), r := wrow(), c := wcol(), w := wselect()
|
||||
LOCAL mr := MRow(), mc := MCol(), r := WRow(), c := WCol(), w := WSelect()
|
||||
|
||||
wselect( 0 )
|
||||
WSelect( 0 )
|
||||
@ MaxRow(), 0 SAY PadR( "WPOS(" + hb_ntos( r ) + "," + hb_ntos( c ) + ")" + ;
|
||||
iif( MPresent(), "MPOS(" + hb_ntos( mr ) + "," + hb_ntos( mc ) + ")", "" ), MaxCol() + 1 )
|
||||
wselect( w )
|
||||
WSelect( w )
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -22,13 +22,13 @@ PROCEDURE Main()
|
||||
FUNCTION CheckDate( dDate )
|
||||
|
||||
? "Testing date:", dDate
|
||||
? "Days in month..:", daysinmonth( dDate )
|
||||
? "Day of year....:", doy( dDate )
|
||||
? "Begin of month.:", bom( dDate )
|
||||
? "End of month...:", eom( dDate )
|
||||
? "Week of month..:", wom( dDate )
|
||||
? "Begin of year..:", boy( dDate )
|
||||
? "End of year....:", eoy( dDate )
|
||||
? "Days in month..:", DaysInMonth( dDate )
|
||||
? "Day of year....:", DoY( dDate )
|
||||
? "Begin of month.:", BoM( dDate )
|
||||
? "End of month...:", EoM( dDate )
|
||||
? "Week of month..:", WoM( dDate )
|
||||
? "Begin of year..:", BoY( dDate )
|
||||
? "End of year....:", EoY( dDate )
|
||||
?
|
||||
|
||||
RETURN NIL
|
||||
|
||||
@@ -191,7 +191,7 @@ FUNCTION addmtest()
|
||||
c := .F.
|
||||
ELSE
|
||||
|
||||
@ 11, 39 SAY "The returned date is " + DToC( addmonth( dDate, mnth ) )
|
||||
@ 11, 39 SAY "The returned date is " + DToC( AddMonth( dDate, mnth ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -235,7 +235,7 @@ FUNCTION bomtest()
|
||||
IF nKey == K_ESC
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The returned date is " + DToC( bom( dDate ) )
|
||||
@ 11, 10 SAY "The returned date is " + DToC( BoM( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -281,7 +281,7 @@ FUNCTION boqtest()
|
||||
IF nKey == K_ESC
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The returned date is " + DToC( boq( dDate ) )
|
||||
@ 11, 10 SAY "The returned date is " + DToC( BoQ( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -325,7 +325,7 @@ FUNCTION boytest()
|
||||
IF nKey == K_ESC
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The returned date is " + DToC( boy( dDate ) )
|
||||
@ 11, 10 SAY "The returned date is " + DToC( BoY( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -374,7 +374,7 @@ FUNCTION ctodowtest()
|
||||
IF nKey == K_ESC
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The day number is " + Str( ctodow( Upper( AllTrim( cDow ) ) ) )
|
||||
@ 11, 10 SAY "The day number is " + Str( CToDoW( Upper( AllTrim( cDow ) ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -424,7 +424,8 @@ FUNCTION ctomonthtest()
|
||||
IF nKey == K_ESC
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The day number is " + Str( ctomonth( cDom ) )
|
||||
@ 11, 10 SAY "The day number is " + Str( CToMonth( cDom ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
SET CURSOR ON
|
||||
@@ -474,7 +475,7 @@ FUNCTION dInMonthtest()
|
||||
|
||||
DO CASE
|
||||
CASE ValType( cMonth ) == "C" .AND. nmonth == 0
|
||||
nMonth := ctomonth( cMonth )
|
||||
nMonth := CToMonth( cMonth )
|
||||
|
||||
CASE nMonth == 0 .OR. ;
|
||||
nMonth > 12
|
||||
@@ -489,7 +490,7 @@ FUNCTION dInMonthtest()
|
||||
ELSE
|
||||
|
||||
@ 10, 40 SAY "The day number is " + ;
|
||||
hb_ntos( daysInMonth( nMonth, IsAffirm( cLeap ) ) )
|
||||
hb_ntos( DaysInMonth( nMonth, IsAffirm( cLeap ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -547,7 +548,7 @@ FUNCTION d2month()
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The day number is " + ;
|
||||
hb_ntos( daystomonth( nMonth, IsAffirm( cLeap ) ) )
|
||||
hb_ntos( DaysToMonth( nMonth, IsAffirm( cLeap ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -604,7 +605,7 @@ FUNCTION dmytest()
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 12, 10 SAY "The date string returned is " + ;
|
||||
LTrim( dmy( dDate, IsAffirm( cMode ) ) )
|
||||
LTrim( DMY( dDate, IsAffirm( cMode ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -653,7 +654,7 @@ FUNCTION doytest()
|
||||
c := .F.
|
||||
ELSE
|
||||
@ 11, 10 SAY "The day of the date entered is " + ;
|
||||
hb_ntos( doy( dDate ) )
|
||||
hb_ntos( DoY( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -702,7 +703,7 @@ FUNCTION eomtest()
|
||||
ELSE
|
||||
|
||||
@ 11, 10 SAY "The last date in the month is " + ;
|
||||
LTrim( DToC( eom( dDate ) ) )
|
||||
LTrim( DToC( EoM( dDate ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -750,7 +751,7 @@ FUNCTION eoqtest()
|
||||
ELSE
|
||||
|
||||
@ 11, 10 SAY "The last date in the month is " + ;
|
||||
LTrim( DToC( eoq( dDate ) ) )
|
||||
LTrim( DToC( EoQ( dDate ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -799,7 +800,7 @@ FUNCTION eoytest()
|
||||
ELSE
|
||||
|
||||
@ 11, 10 SAY "The last date in the year is " + ;
|
||||
LTrim( DToC( eoy( dDate ) ) )
|
||||
LTrim( DToC( EoY( dDate ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -848,7 +849,7 @@ FUNCTION isleaptest()
|
||||
c := .F.
|
||||
ELSE
|
||||
|
||||
IF isleap( dDate )
|
||||
IF IsLeap( dDate )
|
||||
cResult := "TRUE "
|
||||
ELSE
|
||||
cResult := "FALSE"
|
||||
@@ -913,7 +914,7 @@ FUNCTION lastdayomtest()
|
||||
iif( Empty( dDate ), dDate := Val( cMth ), dDate )
|
||||
|
||||
@ 12, 10 SAY "The number of days in the month is " + ;
|
||||
hb_ntos( lastdayom( dDate ) )
|
||||
hb_ntos( LastDayOM( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -965,7 +966,7 @@ FUNCTION mdytest()
|
||||
ELSE
|
||||
|
||||
@ 11, 10 SAY "The date string returned is " + ;
|
||||
LTrim( mdy( dDate ) )
|
||||
LTrim( MDY( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -1015,7 +1016,7 @@ FUNCTION ntocdowtest()
|
||||
ELSE
|
||||
|
||||
@ 11, 10 SAY "The day selected is " + ;
|
||||
PadR( ntocdow( Val( cDay ) ), 10 )
|
||||
PadR( NToCDoW( Val( cDay ) ), 10 )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -1065,7 +1066,7 @@ FUNCTION ntocmthtest()
|
||||
ELSE
|
||||
|
||||
@ 11, 10 SAY "The month selected is " + ;
|
||||
PadR( ntocmonth( Val( cMonth ) ), 10 )
|
||||
PadR( NToCMonth( Val( cMonth ) ), 10 )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -1114,7 +1115,7 @@ FUNCTION qtrtest()
|
||||
ELSE
|
||||
|
||||
@ 8, 10 SAY "The quarter number is " + ;
|
||||
hb_ntos( quarter( dDate ) )
|
||||
hb_ntos( Quarter( dDate ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
@@ -1246,7 +1247,7 @@ FUNCTION weektest()
|
||||
ELSE
|
||||
|
||||
@ 8, 10 SAY "The week number is " + ;
|
||||
hb_ntos( week( dDate, IsAffirm( cMode ) ) )
|
||||
hb_ntos( Week( dDate, IsAffirm( cMode ) ) )
|
||||
|
||||
SET CURSOR OFF
|
||||
Inkey( 0 )
|
||||
|
||||
@@ -61,16 +61,16 @@ PROCEDURE Main()
|
||||
SET DECIMALS TO 15
|
||||
|
||||
FOR n := 1 TO 1000
|
||||
? Str( n, 20, 15 ) + ": " + Str( mantissa( n ), 20, 15 ) + " " + Str( exponent( n ), 4 )
|
||||
? Str( Sqrt( n ), 20, 15 ) + ": " + Str( mantissa( Sqrt( n ) ), 20, 15 ) + " " + Str( exponent( Sqrt( n ) ), 4 )
|
||||
? Str( n, 20, 15 ) + ": " + Str( Mantissa( n ), 20, 15 ) + " " + Str( Exponent( n ), 4 )
|
||||
? Str( Sqrt( n ), 20, 15 ) + ": " + Str( Mantissa( Sqrt( n ) ), 20, 15 ) + " " + Str( Exponent( Sqrt( n ) ), 4 )
|
||||
NEXT
|
||||
|
||||
// The call to str( infinity(.T.) ), generate a GPF.
|
||||
// ?? Str( infinity( .T. ) ) + Str( mantissa( infinity( .T. ) ) ) + Str( exponent( infinity( .T. ) ) )
|
||||
// ?? Str( infinity( .T. ) )
|
||||
|
||||
?? " infinity(.T.): " + Str( mantissa( infinity( .T. ) ), 20, 15 ) + " "
|
||||
? Str( exponent( infinity( .T. ) ), 4 )
|
||||
?? " infinity(.T.): " + Str( Mantissa( Infinity( .T. ) ), 20, 15 ) + " "
|
||||
? Str( Exponent( Infinity( .T. ) ), 4 )
|
||||
|
||||
ctexit()
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ PROCEDURE Main()
|
||||
? "Calculate the monthly payment for a loan of $2000.00 at an annual rate"
|
||||
? "of 10%, within 24 month "
|
||||
? "PAYMENT( 2000.00, 0.10 / 12, 24 ) = 92.290 // CT3"
|
||||
? Space( 28 ), PAYMENT( 2000.00, 0.10 / 12, 24 ), " <-- CT for Harbour"
|
||||
? Space( 28 ), Payment( 2000.00, 0.10 / 12, 24 ), " <-- CT for Harbour"
|
||||
?
|
||||
? " PRESS ANY KEY"
|
||||
|
||||
@@ -89,14 +89,14 @@ PROCEDURE Main()
|
||||
? "Calculate how many month do you need to cancel a loan of $4000.00 at"
|
||||
? "an annual rate of 9.5% with payments of $200.00 max"
|
||||
? "PERIODS( 4000.00, 200.00, 0.095 / 12 ) = 21.859 // CT3"
|
||||
? Space( 33 ), PERIODS( 4000.00, 200.00, 0.095 / 12 ), " <-- CT for Harbour"
|
||||
? Space( 33 ), Periods( 4000.00, 200.00, 0.095 / 12 ), " <-- CT for Harbour"
|
||||
?
|
||||
?
|
||||
|
||||
? "Calculate which is the effective anual rate of your Bank, for a loan"
|
||||
? "of $2500.00 if you pay $86.67 per month for 3 years"
|
||||
? "RATE( 2500.00, 86.67, 36 ) * 12 = 0.1501 // CT3"
|
||||
? Space( 24 ), RATE( 2500.00, 86.67, 36 ) * 12.0, " <-- CT for Harbour"
|
||||
? Space( 24 ), Rate( 2500.00, 86.67, 36 ) * 12.0, " <-- CT for Harbour"
|
||||
?
|
||||
? " PRESS ANY KEY"
|
||||
Inkey( 0 )
|
||||
|
||||
@@ -64,99 +64,99 @@ PROCEDURE Main()
|
||||
?
|
||||
|
||||
? "FLOOR( 1.9 ) = 1 // CT3"
|
||||
? Space( 5 ), FLOOR( 1.9 ), " <-- CT for Harbour"
|
||||
? Space( 5 ), Floor( 1.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( 1.1 ) = 1 // CT3"
|
||||
? Space( 5 ), FLOOR( 1.1 ), " <-- CT for Harbour"
|
||||
? Space( 5 ), Floor( 1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( 0.9 ) = 0 // CT3"
|
||||
? Space( 5 ), FLOOR( 0.9 ), " <-- CT for Harbour"
|
||||
? Space( 5 ), Floor( 0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( -0.1 ) = -1 // CT3"
|
||||
? Space( 7 ), FLOOR( -0.1 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Floor( -0.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( -0.9 ) = -1 // CT3"
|
||||
? Space( 7 ), FLOOR( -0.9 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Floor( -0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( -1.1 ) = -2 // CT3"
|
||||
? Space( 7 ), FLOOR( -1.1 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Floor( -1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
? "CEILING( 1.9 ) = 2 // CT3"
|
||||
? Space( 7 ), CEILING( 1.9 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Ceiling( 1.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( 1.1 ) = 2 // CT3"
|
||||
? Space( 7 ), CEILING( 1.1 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Ceiling( 1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( 0.9 ) = 1 // CT3"
|
||||
? Space( 7 ), CEILING( 0.9 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Ceiling( 0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( -0.1 ) = 0 // CT3"
|
||||
? Space( 8 ), CEILING( -0.1 ), " <-- CT for Harbour"
|
||||
? Space( 8 ), Ceiling( -0.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( -0.9 ) = 0 // CT3"
|
||||
? Space( 8 ), CEILING( -0.9 ), " <-- CT for Harbour"
|
||||
? Space( 8 ), Ceiling( -0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( -1.1 ) = -1 // CT3"
|
||||
? Space( 9 ), CEILING( -1.1 ), " <-- CT for Harbour"
|
||||
? Space( 9 ), Ceiling( -1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
? "LOG10( 0.01 ) = -2.00 // CT3"
|
||||
? Space( 7 ), LOG10( 0.01 ), " <-- CT for Harbour"
|
||||
? Space( 7 ), Log10( 0.01 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "LOG10( 2 ) = 0.30 // CT3"
|
||||
? Space( 3 ), LOG10( 2 ), " <-- CT for Harbour"
|
||||
? Space( 3 ), Log10( 2 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "LOG10( 100 ) = 2.00 // CT3"
|
||||
? Space( 5 ), LOG10( 100 ), " <-- CT for Harbour"
|
||||
? Space( 5 ), Log10( 100 ), " <-- CT for Harbour"
|
||||
?
|
||||
?
|
||||
|
||||
? "SIGN( 48335 ) = 1 // CT3"
|
||||
? Space( 6 ), SIGN( 48335 ), " <-- CT for Harbour"
|
||||
? Space( 6 ), Sign( 48335 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "SIGN( -258 ) = -1 // CT3"
|
||||
? Space( 6 ), SIGN( -258 ), " <-- CT for Harbour"
|
||||
? Space( 6 ), Sign( -258 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
SET DECIMALS TO 0
|
||||
? "FACT( 1 ) = 1 // CT3"
|
||||
? Space( 2 ), FACT( 1 ), " <-- CT for Harbour"
|
||||
? Space( 2 ), Fact( 1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 5 ) = 120 // CT3"
|
||||
? Space( 4 ), FACT( 5 ), " <-- CT for Harbour"
|
||||
? Space( 4 ), Fact( 5 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 21 ) = 51090942171709440000 // CT3"
|
||||
? Space( 12 ), FACT( 21 ), " <-- CT for Harbour"
|
||||
? Space( 12 ), Fact( 21 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 25 ) = -1 // CT3"
|
||||
? Space( 4 ), FACT( 25 ), " <-- CT for Harbour"
|
||||
? Space( 4 ), Fact( 25 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 0 ) = 1 // CT3"
|
||||
? Space( 2 ), FACT( 0 ), " <-- CT for Harbour"
|
||||
? Space( 2 ), Fact( 0 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -61,38 +61,38 @@ PROCEDURE Main()
|
||||
?? "Test of Numeric functions - part 1"
|
||||
|
||||
? "CELSIUS( 33.8 ) = 1 // CT3"
|
||||
? Space( 10 ), CELSIUS( 33.8 ), " <-- CT for Harbour "
|
||||
? Space( 10 ), Celsius( 33.8 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "CELSIUS( 338.0 ) = 170 // CT3"
|
||||
? Space( 11 ), CELSIUS( 338.0 ), " <-- CT for Harbour "
|
||||
? Space( 11 ), Celsius( 338.0 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "CELSIUS( 3380.0 ) = 1860 // CT3"
|
||||
? Space( 12 ), CELSIUS( 3380.0 ), " <-- CT for Harbour "
|
||||
? Space( 12 ), Celsius( 3380.0 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "CELSIUS( -33.8 ) = -36.5555.. // CT3"
|
||||
? Space( 10 ), CELSIUS( -33.8 ), " <-- CT for Harbour "
|
||||
? Space( 10 ), Celsius( -33.8 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "FAHRENHEIT( 12.5 ) = 54.5 // CT3"
|
||||
? Space( 12 ), FAHRENHEIT( 12.5 ), " <-- CT for Harbour "
|
||||
? Space( 12 ), Fahrenheit( 12.5 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "FAHRENHEIT( 125 ) = 257 // CT3"
|
||||
? Space( 12 ), FAHRENHEIT( 125 ), " <-- CT for Harbour "
|
||||
? Space( 12 ), Fahrenheit( 125 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "FAHRENHEIT( 1250 ) = 2282 // CT3"
|
||||
? Space( 14 ), FAHRENHEIT( 1250 ), " <-- CT for Harbour "
|
||||
? Space( 14 ), Fahrenheit( 1250 ), " <-- CT for Harbour "
|
||||
?
|
||||
? "FAHRENHEIT( -155 ) = -247 // CT3"
|
||||
? Space( 14 ), FAHRENHEIT( -155 ), " <-- CT for Harbour "
|
||||
? Space( 14 ), Fahrenheit( -155 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "INFINITY() // CT3"
|
||||
? Space( 8 ), Str( INFINITY(), 30, 15 ), " <-- CT for Harbour"
|
||||
? Space( 8 ), Str( Infinity(), 30, 15 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
? NUMLINE( "" ), 0
|
||||
? NUMLINE( "-" ), 1
|
||||
? NUMLINE( Replicate( "-", 80 ) ), 2
|
||||
? NUMLINE( Replicate( "-", 160 ) ), 3
|
||||
? NUMLINE( Replicate( "-", 100 ), 30 ), 4
|
||||
? NUMLINE( "-" + Chr( 13 ) + Chr( 10 ) ), 2
|
||||
? NUMLINE( "-" + Chr( 10 ) ), 2
|
||||
? NUMLINE( "-" + Chr( 13 ) + Chr( 10 ) + "=" ), 2
|
||||
? NUMLINE( "-" + Chr( 10 ) + "=" ), 2
|
||||
? NUMLINE( Replicate( "-", 100 ) + Chr( 13 ) + Chr( 10 ), 30 ), 5
|
||||
? NUMLINE( Replicate( "-", 100 ) + Chr( 10 ), 30 ), 5
|
||||
? NumLine( "" ), 0
|
||||
? NumLine( "-" ), 1
|
||||
? NumLine( Replicate( "-", 80 ) ), 2
|
||||
? NumLine( Replicate( "-", 160 ) ), 3
|
||||
? NumLine( Replicate( "-", 100 ), 30 ), 4
|
||||
? NumLine( "-" + Chr( 13 ) + Chr( 10 ) ), 2
|
||||
? NumLine( "-" + Chr( 10 ) ), 2
|
||||
? NumLine( "-" + Chr( 13 ) + Chr( 10 ) + "=" ), 2
|
||||
? NumLine( "-" + Chr( 10 ) + "=" ), 2
|
||||
? NumLine( Replicate( "-", 100 ) + Chr( 13 ) + Chr( 10 ), 30 ), 5
|
||||
? NumLine( Replicate( "-", 100 ) + Chr( 10 ), 30 ), 5
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -63,18 +63,18 @@ PROCEDURE Main()
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' numtoken("Hello, World!") == 2 ? ------------------------------> ' + Str( numtoken( "Hello, World!" ), 2 )
|
||||
? ' numtoken("This is good. See you! How do you do?",".!?") == 3 ? -> ' + Str( numtoken( "This is good. See you! How do you do?", ".!?" ), 2 )
|
||||
? ' numtoken("one,,three,four,,six",",",1) == 6 ? -----------------> ' + Str( numtoken( "one,,three,four,,six", ",", 1 ), 2 )
|
||||
? ' numtoken("Hello, World!") == 2 ? ------------------------------> ' + Str( NumToken( "Hello, World!" ), 2 )
|
||||
? ' numtoken("This is good. See you! How do you do?",".!?") == 3 ? -> ' + Str( NumToken( "This is good. See you! How do you do?", ".!?" ), 2 )
|
||||
? ' numtoken("one,,three,four,,six",",",1) == 6 ? -----------------> ' + Str( NumToken( "one,,three,four,,six", ",", 1 ), 2 )
|
||||
?
|
||||
|
||||
? ' # of tokens in the string "' + cStr + '"'
|
||||
? ' separator list = ".,!" and skip width = 1: ' + Str( numtoken( cStr, ".,!", 1 ) )
|
||||
? ' skip width = 3: ' + Str( numtoken( cStr, ".,!", 3 ) )
|
||||
? ' separator list = ",!" and skip width = 1: ' + Str( numtoken( cStr, ",!", 1 ) )
|
||||
? ' skip width = 3: ' + Str( numtoken( cStr, ",!", 3 ) )
|
||||
? ' separator list = "!" and skip width = 1: ' + Str( numtoken( cStr, "!", 1 ) )
|
||||
? ' skip width = 3: ' + Str( numtoken( cStr, "!", 3 ) )
|
||||
? ' separator list = ".,!" and skip width = 1: ' + Str( NumToken( cStr, ".,!", 1 ) )
|
||||
? ' skip width = 3: ' + Str( NumToken( cStr, ".,!", 3 ) )
|
||||
? ' separator list = ",!" and skip width = 1: ' + Str( NumToken( cStr, ",!", 1 ) )
|
||||
? ' skip width = 3: ' + Str( NumToken( cStr, ",!", 3 ) )
|
||||
? ' separator list = "!" and skip width = 1: ' + Str( NumToken( cStr, "!", 1 ) )
|
||||
? ' skip width = 3: ' + Str( NumToken( cStr, "!", 3 ) )
|
||||
|
||||
?
|
||||
? "End test of NUMTOKEN()"
|
||||
|
||||
@@ -59,12 +59,12 @@ PROCEDURE Main()
|
||||
? "Begin test of RANGEREM()"
|
||||
?
|
||||
|
||||
? ' rangerem("0","9","year2002.dbf") == "year.dbf" ? --> "' + ;
|
||||
rangerem( "0", "9", "year2002.dbf" ) + '"'
|
||||
? ' rangerem("9","0","year2002.dbf") == "22" ? --> "' + ;
|
||||
rangerem( "9", "0", "year2002.dbf" ) + '"'
|
||||
? ' rangerem("0","9","yearcurr.dbf") == "yearcurr.dbf" ? --> "' + ;
|
||||
rangerem( "0", "9", "yearcurr.dbf" ) + '"'
|
||||
? ' RangeRem( "0", "9", "year2002.dbf" ) == "year.dbf" ? --> "' + ;
|
||||
RangeRem( "0", "9", "year2002.dbf" ) + '"'
|
||||
? ' RangeRem( "9", "0", "year2002.dbf" ) == "22" ? --> "' + ;
|
||||
RangeRem( "9", "0", "year2002.dbf" ) + '"'
|
||||
? ' RangeRem( "0", "9", "yearcurr.dbf" ) == "yearcurr.dbf" ? --> "' + ;
|
||||
RangeRem( "0", "9", "yearcurr.dbf" ) + '"'
|
||||
|
||||
?
|
||||
? "End test of RANGEREM()"
|
||||
|
||||
@@ -59,12 +59,12 @@ PROCEDURE Main()
|
||||
? "Begin test of RANGEREPL()"
|
||||
?
|
||||
|
||||
? ' rangerepl("0","9","year2002.dbf","?") == "year????.dbf" ? --> "' + ;
|
||||
rangerepl( "0", "9", "year2002.dbf", "?" ) + '"'
|
||||
? ' rangerepl("9","0","year2002.dbf","?") == "????2??2????" ? --> "' + ;
|
||||
rangerepl( "9", "0", "year2002.dbf", "?" ) + '"'
|
||||
? ' rangerepl("0","9","yearcurr.dbf","?") == "yearcurr.dbf" ? --> "' + ;
|
||||
rangerepl( "0", "9", "yearcurr.dbf", "?" ) + '"'
|
||||
? ' RangeRepl( "0", "9", "year2002.dbf", "?" ) == "year????.dbf" ? --> "' + ;
|
||||
RangeRepl( "0", "9", "year2002.dbf", "?" ) + '"'
|
||||
? ' RangeRepl( "9", "0", "year2002.dbf", "?" ) == "????2??2????" ? --> "' + ;
|
||||
RangeRepl( "9", "0", "year2002.dbf", "?" ) + '"'
|
||||
? ' RangeRepl( "0", "9", "yearcurr.dbf", "?" ) == "yearcurr.dbf" ? --> "' + ;
|
||||
RangeRepl( "0", "9", "yearcurr.dbf", "?" ) + '"'
|
||||
|
||||
?
|
||||
? "End test of RANGEREPL()"
|
||||
|
||||
@@ -59,15 +59,15 @@ PROCEDURE Main()
|
||||
ctinit()
|
||||
|
||||
? "Begin test of SETATLIKE()"
|
||||
? " Default mode should be 0, is................................", setatlike()
|
||||
? " Setting mode to 1, return value should be 0, is.............", setatlike( 1 )
|
||||
? " Mode setting should now be 1, is............................", setatlike()
|
||||
? " Setting mode to 0 again, return value should still be 1, is ", setatlike( 0 )
|
||||
? " Default mode should be 0, is................................", SetAtLike()
|
||||
? " Setting mode to 1, return value should be 0, is.............", SetAtLike( 1 )
|
||||
? " Mode setting should now be 1, is............................", SetAtLike()
|
||||
? " Setting mode to 0 again, return value should still be 1, is ", SetAtLike( 0 )
|
||||
?
|
||||
setatlike( , @cWildcard )
|
||||
SetAtLike( , @cWildcard )
|
||||
? " Default wildcard character should be '?', is................", cWildcard
|
||||
setatlike( , "#" )
|
||||
setatlike( , @cWildcard )
|
||||
SetAtLike( , "#" )
|
||||
SetAtLike( , @cWildcard )
|
||||
? " Setting wildcard to '#' and calling SETATLIKE(,@cWildcard)"
|
||||
? " should yield '#' for cWildcard, does......................", cWildcard
|
||||
? "End test of SETATLIKE()"
|
||||
|
||||
@@ -62,12 +62,12 @@ PROCEDURE Main()
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
|
||||
? ' strdiff("ABC", "ADC") == 3 ? -> ', strdiff( "ABC", "ADC" )
|
||||
? ' strdiff("ABC", "AEC") == 3 ? -> ', strdiff( "ABC", "AEC" )
|
||||
? ' strdiff("CBA", "ABC") == 6 ? -> ', strdiff( "CBA", "ABC" )
|
||||
? ' strdiff("ABC", "AXBC") == 1 ? -> ', strdiff( "ABC", "AXBC" )
|
||||
? ' strdiff("AXBC", "ABC") == 6 ? -> ', strdiff( "AXBC", "ABC" )
|
||||
? ' strdiff("AXBC", "ADC") == 9 ? -> ', strdiff( "AXBC", "ADC" )
|
||||
? ' strdiff("ABC", "ADC") == 3 ? -> ', StrDiff( "ABC", "ADC" )
|
||||
? ' strdiff("ABC", "AEC") == 3 ? -> ', StrDiff( "ABC", "AEC" )
|
||||
? ' strdiff("CBA", "ABC") == 6 ? -> ', StrDiff( "CBA", "ABC" )
|
||||
? ' strdiff("ABC", "AXBC") == 1 ? -> ', StrDiff( "ABC", "AXBC" )
|
||||
? ' strdiff("AXBC", "ABC") == 6 ? -> ', StrDiff( "AXBC", "ABC" )
|
||||
? ' strdiff("AXBC", "ADC") == 9 ? -> ', StrDiff( "AXBC", "ADC" )
|
||||
|
||||
? "End test of STRDIFF()"
|
||||
?
|
||||
|
||||
@@ -63,12 +63,12 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' tabexpand("-"+chr(9)+"!") == "- !" ? -> "' + tabexpand( "-" + Chr( 9 ) + "!" ) + '"'
|
||||
? ' tabexpand("----"+chr(9) +"!") == "---- !" ? -> "' + tabexpand( "----" + Chr( 9 ) + "!" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+"!",, "+") == "-+++++++!" ? -> "' + tabexpand( "-" + Chr( 9 ) + "!",, "+" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+ "!", 4) == "- !" ? -> "' + tabexpand( "-" + Chr( 9 ) + "!", 4 ) + '"'
|
||||
? ' tabexpand("----"+chr(9)+ "!", 8) == "---- !" ? -> "' + tabexpand( "----" + Chr( 9 ) + "!", 8 ) + '"'
|
||||
? ' tabexpand("----"+chr(9)+ "!", 8, "+") == "----++++!" ? -> "' + tabexpand( "----" + Chr( 9 ) + "!", 8, "+" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+"!") == "- !" ? -> "' + TabExpand( "-" + Chr( 9 ) + "!" ) + '"'
|
||||
? ' tabexpand("----"+chr(9) +"!") == "---- !" ? -> "' + TabExpand( "----" + Chr( 9 ) + "!" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+"!",, "+") == "-+++++++!" ? -> "' + TabExpand( "-" + Chr( 9 ) + "!",, "+" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+ "!", 4) == "- !" ? -> "' + TabExpand( "-" + Chr( 9 ) + "!", 4 ) + '"'
|
||||
? ' tabexpand("----"+chr(9)+ "!", 8) == "---- !" ? -> "' + TabExpand( "----" + Chr( 9 ) + "!", 8 ) + '"'
|
||||
? ' tabexpand("----"+chr(9)+ "!", 8, "+") == "----++++!" ? -> "' + TabExpand( "----" + Chr( 9 ) + "!", 8, "+" ) + '"'
|
||||
?
|
||||
|
||||
? "Tests with newline characters: ^J == LF, ^M == CR"
|
||||
@@ -76,12 +76,12 @@ PROCEDURE Main()
|
||||
cStr := StrTran( cStr, Chr( 10 ), "^J" )
|
||||
cStr := StrTran( cStr, Chr( 13 ), "^M" )
|
||||
? ' hb_eol() = "' + cStr + '"'
|
||||
cStr := tabexpand( "-" + Chr( 9 ) + "!" + hb_eol() + "----" + Chr( 9 ) + "!", , "+" )
|
||||
cStr := TabExpand( "-" + Chr( 9 ) + "!" + hb_eol() + "----" + Chr( 9 ) + "!", , "+" )
|
||||
cStr := StrTran( cStr, Chr( 10 ), "^J" )
|
||||
cStr := StrTran( cStr, Chr( 13 ), "^M" )
|
||||
? ' tabexpand("-"+chr(9)+"!"+hb_eol()+"----"+chr(9)+ "!",, "+")'
|
||||
? ' == "-+++++++!"+hb_eol()+"----++++!" ? -> "' + cStr + '"'
|
||||
cStr := tabexpand( "-" + Chr( 9 ) + "!$$--" + hb_eol() + "--" + Chr( 9 ) + "!", , "+", "$" )
|
||||
cStr := TabExpand( "-" + Chr( 9 ) + "!$$--" + hb_eol() + "--" + Chr( 9 ) + "!", , "+", "$" )
|
||||
cStr := StrTran( cStr, Chr( 10 ), "^J" )
|
||||
cStr := StrTran( cStr, Chr( 13 ), "^M" )
|
||||
? ' tabexpand("-"+chr(9)+"!$$--"+hb_eol()+--"+chr(9)+ "!",, "+", "$")'
|
||||
@@ -90,9 +90,9 @@ PROCEDURE Main()
|
||||
?
|
||||
|
||||
? "Tests with tab characters:"
|
||||
? ' tabexpand("-"+chr(9)+"-",,"+") == "-+++++++-" ? -> "' + tabexpand( "-" + Chr( 9 ) + "-",, "+" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+"-",,"+") == "-+++++++-" ? -> "' + TabExpand( "-" + Chr( 9 ) + "-",, "+" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+"-",,"+",,"-")'
|
||||
? ' == "++++++++^I+++++++" ? -> "' + StrTran( tabexpand( "-" + Chr( 9 ) + "-",, "+",, "-" ), Chr( 9 ), "^I" ) + '"'
|
||||
? ' == "++++++++^I+++++++" ? -> "' + StrTran( TabExpand( "-" + Chr( 9 ) + "-",, "+",, "-" ), Chr( 9 ), "^I" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of TABEXPAND()"
|
||||
@@ -106,9 +106,9 @@ PROCEDURE Main()
|
||||
// simple tests
|
||||
? "Simple tests: ^I == tab character"
|
||||
|
||||
? ' tabpack("AAAAAAA*",, "*") == "AAAAAAA*" ? -> "' + StrTran( tabpack( "AAAAAAA*",, "*" ), Chr( 9 ), "^I" ) + '"'
|
||||
? ' tabpack("AAAAA***",, "*") == "AAAAA^I" ? -> "' + StrTran( tabpack( "AAAAA***",, "*" ), Chr( 9 ), "^I" ) + '"'
|
||||
? ' tabpack("AAAAA*****",, "*") == "AAAAA^I**" ? -> "' + StrTran( tabpack( "AAAAA*****",, "*" ), Chr( 9 ), "^I" ) + '"'
|
||||
? ' tabpack("AAAAAAA*",, "*") == "AAAAAAA*" ? -> "' + StrTran( TabPack( "AAAAAAA*",, "*" ), Chr( 9 ), "^I" ) + '"'
|
||||
? ' tabpack("AAAAA***",, "*") == "AAAAA^I" ? -> "' + StrTran( TabPack( "AAAAA***",, "*" ), Chr( 9 ), "^I" ) + '"'
|
||||
? ' tabpack("AAAAA*****",, "*") == "AAAAA^I**" ? -> "' + StrTran( TabPack( "AAAAA*****",, "*" ), Chr( 9 ), "^I" ) + '"'
|
||||
?
|
||||
|
||||
? "Tests with newline characters:"
|
||||
@@ -118,7 +118,7 @@ PROCEDURE Main()
|
||||
? ' hb_eol() = "' + cStr + '"'
|
||||
|
||||
cStr := "ABCD+" + hb_eol() + "++---+++++"
|
||||
cStr := tabpack( cStr, 4, "+" )
|
||||
cStr := TabPack( cStr, 4, "+" )
|
||||
cStr := StrTran( cStr, Chr( 10 ), "^J" )
|
||||
cStr := StrTran( cStr, Chr( 13 ), "^M" )
|
||||
cStr := StrTran( cStr, Chr( 9 ), "^I" )
|
||||
@@ -140,7 +140,7 @@ PROCEDURE Main()
|
||||
cStr := MemoEdit( , 1, 1, 9, 59,,, 59 )
|
||||
CLS
|
||||
? " Now printing the expanded text using a tab length of 4 and soft CRs"
|
||||
cStr1 := tabexpand( cStr, 4, "+",,, .F. )
|
||||
cStr1 := TabExpand( cStr, 4, "+",,, .F. )
|
||||
cStr1 := StrTran( cStr, Chr( 141 ), hb_eol() )
|
||||
|
||||
FOR ni := 1 TO MLCount( cStr1, 59, 4, .T. )
|
||||
@@ -148,7 +148,7 @@ PROCEDURE Main()
|
||||
NEXT
|
||||
|
||||
QOut( " Now printing the expanded text using a tab length of 4 but without soft CRs" )
|
||||
cStr1 := tabexpand( cStr, 4, "+",,, .T. )
|
||||
cStr1 := TabExpand( cStr, 4, "+",,, .T. )
|
||||
|
||||
FOR ni := 1 TO MLCount( cStr1, 59, 4, .T. )
|
||||
? " " + Str( ni ) + ": " + MemoLine( cStr1, 59, ni, 4, .T. )
|
||||
|
||||
@@ -70,27 +70,27 @@ PROCEDURE Main()
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' token("Hello, World!") == "World" ? -----------> "' + token( "Hello, World!" ) + '"'
|
||||
? ' token("Hello, World!",,2,1) == "" ? -----------> "' + token( "Hello, World!",, 2, 1 ) + '"'
|
||||
? ' token("Hello, World!",",",2,1) == " World!" ? -> "' + token( "Hello, World!", ",", 2, 1 ) + '"'
|
||||
? ' token("Hello, World!"," ",2,1) == "World!" ? --> "' + token( "Hello, World!", " ", 2, 1 ) + '"'
|
||||
? ' token("Hello, World!") == "World" ? -----------> "' + Token( "Hello, World!" ) + '"'
|
||||
? ' token("Hello, World!",,2,1) == "" ? -----------> "' + Token( "Hello, World!",, 2, 1 ) + '"'
|
||||
? ' token("Hello, World!",",",2,1) == " World!" ? -> "' + Token( "Hello, World!", ",", 2, 1 ) + '"'
|
||||
? ' token("Hello, World!"," ",2,1) == "World!" ? --> "' + Token( "Hello, World!", " ", 2, 1 ) + '"'
|
||||
?
|
||||
|
||||
? ' Tokenizing the string "' + cStr + '"'
|
||||
? ' with skip width == 1 and ".,!" as tokenizer list:'
|
||||
?
|
||||
FOR ni := 1 TO numtoken( cStr, ".,!", 1 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 1, @cPre, @cPost ) + ;
|
||||
'") @ pos ' + Str( npos := attoken( cStr, ".,!", ni, 1 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty"
|
||||
FOR ni := 1 TO NumToken( cStr, ".,!", 1 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".,!", ni, 1, @cPre, @cPost ) + ;
|
||||
'") @ pos ' + Str( npos := AtToken( cStr, ".,!", ni, 1 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty"
|
||||
NEXT
|
||||
|
||||
?
|
||||
? ' Tokenizing the string "' + cStr + '"'
|
||||
? ' with skip width == 3 and ".,!" as tokenizer list:'
|
||||
?
|
||||
FOR ni := 1 TO numtoken( cStr, ".,!", 3 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 3, @cPre, @cPost ) + ;
|
||||
'") @ pos ' + Str( npos := attoken( cStr, ".,!", ni, 3 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty."
|
||||
FOR ni := 1 TO NumToken( cStr, ".,!", 3 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".,!", ni, 3, @cPre, @cPost ) + ;
|
||||
'") @ pos ' + Str( npos := AtToken( cStr, ".,!", ni, 3 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty."
|
||||
NEXT
|
||||
|
||||
?
|
||||
|
||||
@@ -78,24 +78,24 @@ PROCEDURE Main()
|
||||
|
||||
// Some simple tests with global token environment
|
||||
? ' Incremental tokenizing the string "' + cStr1 + '"'
|
||||
? ' tokeninit(@cStr1, ",", 1) == .T. ? ----> ' + ltoc( tokeninit( @cStr1, ",", 1 ) )
|
||||
? ' tokennum() == 6 ? ---------------------> ' + Str( tokennum() )
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
WHILE ! tokenend()
|
||||
? ' tokennext(@cStr1) ------------------> "' + tokennext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
? ' tokeninit(@cStr1, ",", 1) == .T. ? ----> ' + LToC( TokenInit( @cStr1, ",", 1 ) )
|
||||
? ' tokennum() == 6 ? ---------------------> ' + Str( TokenNum() )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext(@cStr1) ------------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
?
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + ltoc( tokeninit() )
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
WHILE ! tokenend()
|
||||
? ' tokennext(@cStr1) ------------------> "' + tokennext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext(@cStr1) ------------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
?
|
||||
? ' access tokens directly with tokennext'
|
||||
? ' tokennext(@cStr1,2) == "BB" ? -------> "' + tokennext( @cStr1, 2 ) + '"'
|
||||
? ' tokennext(@cStr1,4) == "DDDD" ? -----> "' + tokennext( @cStr1, 4 ) + '"'
|
||||
? ' tokennext(@cStr1,2) == "BB" ? -------> "' + TokenNext( @cStr1, 2 ) + '"'
|
||||
? ' tokennext(@cStr1,4) == "DDDD" ? -----> "' + TokenNext( @cStr1, 4 ) + '"'
|
||||
?
|
||||
|
||||
? "...Press any key..."
|
||||
@@ -104,24 +104,24 @@ PROCEDURE Main()
|
||||
|
||||
? ' Incremental tokenizing the string "' + cStr3 + '" with the'
|
||||
? ' token environment of cStr1 !'
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + ltoc( tokeninit() )
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
WHILE ! tokenend()
|
||||
? ' tokennext(@cStr3) ------------------> "' + tokennext( @cStr3 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext(@cStr3) ------------------> "' + TokenNext( @cStr3 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
?
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + ltoc( tokeninit() )
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
WHILE ! tokenend()
|
||||
? ' start & end with tokenat(.F./.T.)-----> ' + Str( tokenat() ) + ' ' + Str( tokenat( .T. ) )
|
||||
tokennext( @cStr1 )
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' start & end with tokenat(.F./.T.)-----> ' + Str( TokenAt() ) + ' ' + Str( TokenAt( .T. ) )
|
||||
TokenNext( @cStr1 )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
?
|
||||
? ' access tokens directly with tokenat'
|
||||
? ' tokenat( .F., 2 ) == 3 ? ---------------> ' + Str( tokenat( .F., 2 ) )
|
||||
? ' tokenat( .T., 4 ) == 14 ? --------------> ' + Str( tokenat( .T., 4 ) )
|
||||
? ' tokenat( .F., 2 ) == 3 ? ---------------> ' + Str( TokenAt( .F., 2 ) )
|
||||
? ' tokenat( .T., 4 ) == 14 ? --------------> ' + Str( TokenAt( .T., 4 ) )
|
||||
?
|
||||
|
||||
? "...Press any key..."
|
||||
@@ -129,21 +129,21 @@ PROCEDURE Main()
|
||||
Inkey( 0 )
|
||||
|
||||
? ' Save global token environment with savetoken'
|
||||
cTE1 := savetoken()
|
||||
cTE1 := SaveToken()
|
||||
? ' tokeninit a different string, cStr4 := "' + cStr4 + '", with tokeninit()'
|
||||
? ' tokeninit( @cStr4, ":", 1 ) == .T. ? ----> ' + ltoc( tokeninit( @cStr4, ":", 1 ) )
|
||||
? ' tokennum() == 5 ? ---------------------> ' + Str( tokennum() )
|
||||
? ' tokennext() == "08" ? ------------------> "' + tokennext( @cStr4 ) + '"'
|
||||
? ' tokeninit( @cStr4, ":", 1 ) == .T. ? ----> ' + LToC( TokenInit( @cStr4, ":", 1 ) )
|
||||
? ' tokennum() == 5 ? ---------------------> ' + Str( TokenNum() )
|
||||
? ' tokennext() == "08" ? ------------------> "' + TokenNext( @cStr4 ) + '"'
|
||||
? ' Now restore global token environment with resttoken and rewind it'
|
||||
resttoken( cTE1 )
|
||||
tokeninit()
|
||||
? ' tokennum() == 6 ? ----------------------> ' + Str( tokennum() )
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
WHILE ! tokenend()
|
||||
? ' tokennext( @cStr1 ) -----------------> "' + tokennext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + ltoc( tokenend() )
|
||||
RestToken( cTE1 )
|
||||
TokenInit()
|
||||
? ' tokennum() == 6 ? ----------------------> ' + Str( TokenNum() )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext( @cStr1 ) -----------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
? ' Release global TE with tokenexit() ----> ' + ltoc( tokenexit() )
|
||||
? ' Release global TE with tokenexit() ----> ' + LToC( TokenExit() )
|
||||
?
|
||||
|
||||
? "...Press any key..."
|
||||
@@ -153,17 +153,17 @@ PROCEDURE Main()
|
||||
? ' Now tokenize cStr4 := "' + cStr4 + '" and'
|
||||
? ' cStr5 := "' + cStr5 + '"'
|
||||
? ' and store the token environment locally to cTE1 and cTE2:'
|
||||
? ' tokeninit( @cStr4, ":", 1, @cTE1 ) == .T. ? -> ' + ltoc( tokeninit( @cStr4, ":", 1, @cTE1 ) )
|
||||
? ' tokeninit( @cStr5, "+", 1, @cTE2 ) == .T. ? -> ' + ltoc( tokeninit( @cStr5, "+", 1, @cTE2 ) )
|
||||
? ' tokennum( @cTE1 ) == 5 ? --------------------> ' + Str( tokennum( @cTE1 ) )
|
||||
? ' tokennum( @cTE2 ) == 4 ? --------------------> ' + Str( tokennum( @cTE2 ) )
|
||||
? ' tokenend( @cTE1 ) ? ---------------------> ' + ltoc( tokenend( @cTE1 ) )
|
||||
? ' tokenend( @cTE2 ) ? ---------------------> ' + ltoc( tokenend( @cTE2 ) )
|
||||
WHILE ! tokenend( @cTE1 ) .AND. ! tokenend( @cTE2 )
|
||||
? ' next train at ' + tokennext( cStr4,, @cTE1 ) + ":" + tokennext( cStr5,, @cTE2 )
|
||||
? ' tokeninit( @cStr4, ":", 1, @cTE1 ) == .T. ? -> ' + LToC( TokenInit( @cStr4, ":", 1, @cTE1 ) )
|
||||
? ' tokeninit( @cStr5, "+", 1, @cTE2 ) == .T. ? -> ' + LToC( TokenInit( @cStr5, "+", 1, @cTE2 ) )
|
||||
? ' tokennum( @cTE1 ) == 5 ? --------------------> ' + Str( TokenNum( @cTE1 ) )
|
||||
? ' tokennum( @cTE2 ) == 4 ? --------------------> ' + Str( TokenNum( @cTE2 ) )
|
||||
? ' tokenend( @cTE1 ) ? ---------------------> ' + LToC( TokenEnd( @cTE1 ) )
|
||||
? ' tokenend( @cTE2 ) ? ---------------------> ' + LToC( TokenEnd( @cTE2 ) )
|
||||
WHILE ! TokenEnd( @cTE1 ) .AND. ! TokenEnd( @cTE2 )
|
||||
? ' next train at ' + TokenNext( cStr4,, @cTE1 ) + ":" + TokenNext( cStr5,, @cTE2 )
|
||||
? ' compiled with tokennext( cStr4,, @cTE1 ) + ":" + tokennext( cStr5,, @cTE2 )'
|
||||
? ' tokenend( @cTE1 ) ? ---------------------> ' + ltoc( tokenend( @cTE1 ) )
|
||||
? ' tokenend( @cTE2 ) ? ---------------------> ' + ltoc( tokenend( @cTE2 ) )
|
||||
? ' tokenend( @cTE1 ) ? ---------------------> ' + LToC( TokenEnd( @cTE1 ) )
|
||||
? ' tokenend( @cTE2 ) ? ---------------------> ' + LToC( TokenEnd( @cTE2 ) )
|
||||
ENDDO
|
||||
|
||||
?
|
||||
|
||||
@@ -64,20 +64,20 @@ PROCEDURE Main()
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' tokenlower("Hello, World, here I am!") == "hello, world, here i am!" ?'
|
||||
? ' -> "' + tokenlower( "Hello, World, here I am!" ) + '"'
|
||||
? ' -> "' + TokenLower( "Hello, World, here I am!" ) + '"'
|
||||
? ' tokenlower("Hello, World, here I am!",,3) == "hello, world, here I am!" ?'
|
||||
? ' -> "' + tokenlower( "Hello, World, here I am!",, 3 ) + '"'
|
||||
? ' -> "' + TokenLower( "Hello, World, here I am!",, 3 ) + '"'
|
||||
? ' tokenlower("Hello, World, here I am!",",",3) == "hello, World, here I am!" ?'
|
||||
? ' -> "' + tokenlower( "Hello, World, here I am!", ",", 3 ) + '"'
|
||||
? ' -> "' + TokenLower( "Hello, World, here I am!", ",", 3 ) + '"'
|
||||
? ' tokenlower("Hello, World, here I am!"," W") == "hello, World, here i am!" ?'
|
||||
? ' -> "' + tokenlower( "Hello, World, here I am!", " W" ) + '"'
|
||||
? ' -> "' + TokenLower( "Hello, World, here I am!", " W" ) + '"'
|
||||
?
|
||||
|
||||
? ' Lowercase the tokens in the string "' + cStr + '"'
|
||||
? ' with csetref(.T.) and "@"'
|
||||
csetref( .T. )
|
||||
CSetRef( .T. )
|
||||
?
|
||||
? ' --> return value of tokenlower(@cStr): ', tokenlower( @cStr )
|
||||
? ' --> return value of tokenlower(@cStr): ', TokenLower( @cStr )
|
||||
? ' --> cStr is now: "' + cStr + '"'
|
||||
|
||||
?
|
||||
|
||||
@@ -70,18 +70,18 @@ PROCEDURE Main()
|
||||
? ' Tokenizing the string "' + cStr + '"'
|
||||
? ' with skip width == 1 and ".,!" as tokenizer list:'
|
||||
?
|
||||
FOR ni := 1 TO numtoken( cStr, ".,!", 1 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 1 ) + ;
|
||||
'") is tokenized by "' + tokensep( .F. ) + '" and "' + tokensep( .T. ) + '"'
|
||||
FOR ni := 1 TO NumToken( cStr, ".,!", 1 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".,!", ni, 1 ) + ;
|
||||
'") is tokenized by "' + TokenSep( .F. ) + '" and "' + TokenSep( .T. ) + '"'
|
||||
NEXT
|
||||
|
||||
?
|
||||
? ' Tokenizing the string "' + cStr + '"'
|
||||
? ' with skip width == 3 and ".,!" as tokenizer list:'
|
||||
?
|
||||
FOR ni := 1 TO numtoken( cStr, ".,!", 3 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + token( cStr, ".,!", ni, 3 ) + ;
|
||||
'") is tokenized by "' + tokensep( .F. ) + '" and "' + tokensep( .T. ) + '"'
|
||||
FOR ni := 1 TO NumToken( cStr, ".,!", 3 )
|
||||
? ' Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".,!", ni, 3 ) + ;
|
||||
'") is tokenized by "' + TokenSep( .F. ) + '" and "' + TokenSep( .T. ) + '"'
|
||||
NEXT
|
||||
|
||||
?
|
||||
|
||||
@@ -64,20 +64,20 @@ PROCEDURE Main()
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' tokenupper("Hello, world, here I am!") == "Hello, World, Here I Am!" ?'
|
||||
? ' -> "' + tokenupper( "Hello, world, here I am!" ) + '"'
|
||||
? ' -> "' + TokenUpper( "Hello, world, here I am!" ) + '"'
|
||||
? ' tokenupper("Hello, world, here I am!",,3) == "Hello, World, Here I am!" ?'
|
||||
? ' -> "' + tokenupper( "Hello, world, here I am!",, 3 ) + '"'
|
||||
? ' -> "' + TokenUpper( "Hello, world, here I am!",, 3 ) + '"'
|
||||
? ' tokenupper("Hello, world, here I am!",",",3) == "Hello, world, here I am!" ?'
|
||||
? ' -> "' + tokenupper( "Hello, world, here I am!", ",", 3 ) + '"'
|
||||
? ' -> "' + TokenUpper( "Hello, world, here I am!", ",", 3 ) + '"'
|
||||
? ' tokenupper("Hello, world, here I am!"," w") == "Hello, wOrld, Here I Am!" ?'
|
||||
? ' -> "' + tokenupper( "Hello, world, here I am!", " w" ) + '"'
|
||||
? ' -> "' + TokenUpper( "Hello, world, here I am!", " w" ) + '"'
|
||||
?
|
||||
|
||||
? ' Uppercase the tokens in the string "' + cStr + '"'
|
||||
? ' with csetref(.T.) and "@"'
|
||||
csetref( .T. )
|
||||
CSetRef( .T. )
|
||||
?
|
||||
? ' --> return value of tokenupper(@cStr): ', tokenupper( @cStr )
|
||||
? ' --> return value of tokenupper(@cStr): ', TokenUpper( @cStr )
|
||||
? ' --> cStr is now: "' + cStr + '"'
|
||||
|
||||
?
|
||||
|
||||
@@ -71,44 +71,44 @@ PROCEDURE Main()
|
||||
CLS
|
||||
? "Begin test of Trigonometric functions... "
|
||||
?
|
||||
? "PI = " + Str( PI(), 18, 15 )
|
||||
? "PI = " + Str( Pi(), 18, 15 )
|
||||
|
||||
? "STR( SIN( PI() / 4 ), 18, 15 ) = 0.707106781186548 // CT3"
|
||||
? Space( 33 ) + Str( SIN( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( SIN( Pi() / 4 ), 18, 15 ) = 0.707106781186548 // CT3"
|
||||
? Space( 33 ) + Str( Sin( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( SIN( PI() / 2 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( SIN( PI() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( SIN( Pi() / 2 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( Sin( Pi() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( SIN( PI() * 99.5 ), 18, 15 ) = -1.000000000000000 // CT3"
|
||||
? Space( 36 ) + Str( SIN( PI() * 99.5 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( SIN( Pi() * 99.5 ), 18, 15 ) = -1.000000000000000 // CT3"
|
||||
? Space( 36 ) + Str( Sin( Pi() * 99.5 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( SIN( PI() / 9 ), 18, 15 ) = 0.342020143325669 // CT3"
|
||||
? Space( 33 ) + Str( SIN( PI() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( SIN( Pi() / 9 ), 18, 15 ) = 0.342020143325669 // CT3"
|
||||
? Space( 33 ) + Str( Sin( Pi() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
|
||||
WAIT4()
|
||||
|
||||
|
||||
? "STR( COS( 0 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 26 ) + Str( COS( 0 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? Space( 26 ) + Str( Cos( 0 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COS( PI() / 4 ), 18, 15 ) = 0.707106781186548 // CT3"
|
||||
? Space( 33 ) + Str( COS( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COS( Pi() / 4 ), 18, 15 ) = 0.707106781186548 // CT3"
|
||||
? Space( 33 ) + Str( Cos( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COS( PI() / 2 ), 18, 15 ) = 0.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( COS( PI() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COS( Pi() / 2 ), 18, 15 ) = 0.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( Cos( Pi() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COS( PI() * 99.5 ), 18, 15 ) = 0.000000000000000 // CT3"
|
||||
? Space( 35 ) + Str( COS( PI() * 99.5 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COS( Pi() * 99.5 ), 18, 15 ) = 0.000000000000000 // CT3"
|
||||
? Space( 35 ) + Str( Cos( Pi() * 99.5 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COS( PI() / 9 ), 18, 15 ) = 0.939692620785908 // CT3"
|
||||
? Space( 33 ) + Str( COS( PI() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COS( Pi() / 9 ), 18, 15 ) = 0.939692620785908 // CT3"
|
||||
? Space( 33 ) + Str( Cos( Pi() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
|
||||
@@ -116,75 +116,75 @@ PROCEDURE Main()
|
||||
|
||||
|
||||
? "STR( TAN( 0 ), 18, 15 ) = 1.000000000000000 // CT3 wrong ! "
|
||||
? Space( 26 ) + Str( TAN( 0 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? Space( 26 ) + Str( Tan( 0 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( TAN( PI() / 4 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( TAN( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( TAN( Pi() / 4 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( Tan( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( TAN( PI() / 9 ), 18, 15 ) = 0.363970234266202 // CT3"
|
||||
? Space( 33 ) + Str( TAN( PI() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( TAN( Pi() / 9 ), 18, 15 ) = 0.363970234266202 // CT3"
|
||||
? Space( 33 ) + Str( Tan( Pi() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
?
|
||||
?
|
||||
|
||||
? "STR( ASIN( 0.5 ), 18, 15 ) = 0.523598775598299 // CT3"
|
||||
? Space( 29 ) + Str( ASIN( 0.5 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? Space( 29 ) + Str( Asin( 0.5 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( ACOS( 0.7 ), 18, 15 ) = 0.795398830184144 // CT3"
|
||||
? Space( 29 ) + Str( ACOS( 0.7 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? Space( 29 ) + Str( Acos( 0.7 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( ATAN( PI() / 4 ), 18, 15 ) = 0.665773750028354 // CT3"
|
||||
? Space( 34 ) + Str( ATAN( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( ATAN( Pi() / 4 ), 18, 15 ) = 0.665773750028354 // CT3"
|
||||
? Space( 34 ) + Str( Atan( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
|
||||
? "STR( COT( PI() / 4 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( COT( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COT( Pi() / 4 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( Cot( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COT( PI() / 2 ), 18, 15 ) = 0.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( COT( PI() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COT( Pi() / 2 ), 18, 15 ) = 0.000000000000000 // CT3"
|
||||
? Space( 33 ) + Str( Cot( Pi() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COT( PI() / 9 ), 18, 15 ) = 2.747477419454622 // CT3"
|
||||
? Space( 33 ) + Str( COT( PI() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COT( Pi() / 9 ), 18, 15 ) = 2.747477419454622 // CT3"
|
||||
? Space( 33 ) + Str( Cot( Pi() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
?? "Testing Hiperbolic Sine..."
|
||||
?
|
||||
? "STR( SINH( PI() / 2 ), 18, 15 ) = 2.301298902307295 // CT3"
|
||||
? Space( 34 ) + Str( SINH( PI() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( SINH( Pi() / 2 ), 18, 15 ) = 2.301298902307295 // CT3"
|
||||
? Space( 34 ) + Str( Sinh( Pi() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( SINH( PI() / 4 ), 18, 15 ) = 0.868670961486010 // CT3"
|
||||
? Space( 34 ) + Str( SINH( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( SINH( Pi() / 4 ), 18, 15 ) = 0.868670961486010 // CT3"
|
||||
? Space( 34 ) + Str( Sinh( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "Testing Hiperbolic Cosine..."
|
||||
?
|
||||
? "STR( COSH( PI() / 2 ), 18, 15 ) = 2.509178478658057 // CT3"
|
||||
? Space( 34 ) + Str( COSH( PI() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COSH( Pi() / 2 ), 18, 15 ) = 2.509178478658057 // CT3"
|
||||
? Space( 34 ) + Str( Cosh( Pi() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COSH( PI() / 4 ), 18, 15 ) = 1.324609089252006 // CT3"
|
||||
? Space( 34 ) + Str( COSH( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( COSH( Pi() / 4 ), 18, 15 ) = 1.324609089252006 // CT3"
|
||||
? Space( 34 ) + Str( Cosh( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "Testing Hiperbolic Tangent..."
|
||||
?
|
||||
? "STR( TANH( PI() / 2 ), 18, 15 ) = 0.917152335667274 // CT3"
|
||||
? Space( 34 ) + Str( TANH( PI() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( TANH( Pi() / 2 ), 18, 15 ) = 0.917152335667274 // CT3"
|
||||
? Space( 34 ) + Str( Tanh( Pi() / 2 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
? "STR( TANH( PI() / 4 ), 18, 15 ) = 0.655794202632672 // CT3"
|
||||
? Space( 34 ) + Str( TANH( PI() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? "STR( TANH( Pi() / 4 ), 18, 15 ) = 0.655794202632672 // CT3"
|
||||
? Space( 34 ) + Str( Tanh( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
@@ -192,40 +192,40 @@ PROCEDURE Main()
|
||||
? "Testing Degree TO Radian..."
|
||||
?
|
||||
? "STR( DTOR( 360 ), 18, 15 ) = 6.283185307179588 // CT3"
|
||||
? Space( 28 ) + Str( DTOR( 360 ), 18, 15 ), " <-- CT for Harbour "
|
||||
? Space( 28 ) + Str( DToR( 360 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( 180 ), 18, 15 ) = 3.141592653589794 // CT3"
|
||||
? Space( 28 ) + Str( DTOR( 180 ), 18, 15 ), " <-- CT for Harbour "
|
||||
? Space( 28 ) + Str( DToR( 180 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( 180.5 ), 18, 15 ) = 3.150319299849766 // CT3"
|
||||
? Space( 30 ) + Str( DTOR( 180.5 ), 18, 15 ), " <-- CT for Harbour "
|
||||
? Space( 30 ) + Str( DToR( 180.5 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( 720 ), 18, 15 ) = 12.566370614359180 // CT3"
|
||||
? Space( 29 ) + Str( DTOR( 720 ), 18, 15 ), " <-- CT for Harbour "
|
||||
? Space( 29 ) + Str( DToR( 720 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( -180 ), 18, 15 ) = -3.141592653589794 // CT3"
|
||||
? Space( 30 ) + Str( DTOR( -180 ), 18, 15 ), " <-- CT for Harbour "
|
||||
? Space( 30 ) + Str( DToR( -180 ), 18, 15 ), " <-- CT for Harbour "
|
||||
|
||||
WAIT4()
|
||||
|
||||
|
||||
? "Testing Radian TO Degree..."
|
||||
?
|
||||
? "RTOD( PI() ) = 180 // CT3 "
|
||||
? Space( 7 ), RTOD( PI() ), " <-- CT for Harbour "
|
||||
? "RTOD( Pi() ) = 180 // CT3 "
|
||||
? Space( 7 ), RToD( Pi() ), " <-- CT for Harbour "
|
||||
|
||||
? "RTOD( 2 * PI() ) = 360 // CT3 "
|
||||
? Space( 11 ), RTOD( 2 * PI() ), " <-- CT for Harbour "
|
||||
? "RTOD( 2 * Pi() ) = 360 // CT3 "
|
||||
? Space( 11 ), RToD( 2 * Pi() ), " <-- CT for Harbour "
|
||||
|
||||
? "RTOD( 4 * PI() ) = 720 // CT3 "
|
||||
? Space( 11 ), RTOD( 4 * PI() ), " <-- CT for Harbour "
|
||||
? "RTOD( 4 * Pi() ) = 720 // CT3 "
|
||||
? Space( 11 ), RToD( 4 * Pi() ), " <-- CT for Harbour "
|
||||
|
||||
? "RTOD( -PI() ) = -180 // CT3"
|
||||
? Space( 9 ), RTOD( -PI() ), " <-- CT for Harbour "
|
||||
? "RTOD( -Pi() ) = -180 // CT3"
|
||||
? Space( 9 ), RToD( -Pi() ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
@@ -238,15 +238,15 @@ PROCEDURE Main()
|
||||
|
||||
? "Testing ATN2( x, y )... where:"
|
||||
|
||||
x := SIN( DTOR( 30 ) )
|
||||
y := COS( DTOR( 30 ) )
|
||||
x := Sin( DToR( 30 ) )
|
||||
y := Cos( DToR( 30 ) )
|
||||
? "x = SIN( DTOR( 30 ) ) =", x
|
||||
? "y = COS( DTOR( 30 ) ) =", y
|
||||
?
|
||||
? "STR( ATN2( x, y ), 18, 15 ) = 0.523598775598299 // CT3"
|
||||
? Space( 30 ) + Str( ATN2( x, y ), 18, 15 ) + " <-- CT for Harbour"
|
||||
? Space( 30 ) + Str( Atn2( x, y ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
? "RTOD( ATN2( x, y ) ) =" + Str( RTOD( ATN2( x, y ) ), 18, 4 ) + " <-- CT for Harbour"
|
||||
? "RTOD( ATN2( x, y ) ) =" + Str( RToD( Atn2( x, y ) ), 18, 4 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
@@ -59,10 +59,10 @@ PROCEDURE Main()
|
||||
? "Begin test of VALPOS()"
|
||||
?
|
||||
|
||||
? ' valpos("1234x56789") == 9 ? --> ' + Str( valpos( "1234x56789" ) )
|
||||
? ' valpos("1234x56789",1) == 1 ? --> ' + Str( valpos( "1234x56789", 1 ) )
|
||||
? ' valpos("1234x56789",11) == 0 ? --> ' + Str( valpos( "1234x56789", 11 ) )
|
||||
? ' valpos("1234x56789",5) == 0 ? --> ' + Str( valpos( "1234x56789", 5 ) )
|
||||
? ' valpos("1234x56789") == 9 ? --> ' + Str( ValPos( "1234x56789" ) )
|
||||
? ' valpos("1234x56789",1) == 1 ? --> ' + Str( ValPos( "1234x56789", 1 ) )
|
||||
? ' valpos("1234x56789",11) == 0 ? --> ' + Str( ValPos( "1234x56789", 11 ) )
|
||||
? ' valpos("1234x56789",5) == 0 ? --> ' + Str( ValPos( "1234x56789", 5 ) )
|
||||
|
||||
?
|
||||
? "End test of VALPOS()"
|
||||
|
||||
@@ -61,9 +61,9 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' wordone("12ABAB12") == "12AB12" ? --> "' + wordone( "12ABAB12" ) + '"'
|
||||
? ' wordone("1AAAA2") == "1AAAA2" ? --> "' + wordone( "1AAAA2" ) + '"'
|
||||
? ' wordone("12", "1212ABAB") == "12ABAB" ? --> "' + wordone( "12", "1212ABAB" ) + '"'
|
||||
? ' wordone("12ABAB12") == "12AB12" ? --> "' + WordOne( "12ABAB12" ) + '"'
|
||||
? ' wordone("1AAAA2") == "1AAAA2" ? --> "' + WordOne( "1AAAA2" ) + '"'
|
||||
? ' wordone("12", "1212ABAB") == "12ABAB" ? --> "' + WordOne( "12", "1212ABAB" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of WORDONE()"
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' wordonly("AABBCCDD", "XXAAYYBBZZ") == "AABB" ? --> "' + wordonly( "AABBCCDD", "XXAAYYBBZZ" ) + '"'
|
||||
? ' wordonly("AABBCCDD", "XAAYYYBBZZ") == "BB" ? ----> "' + wordonly( "AABBCCDD", "XAAYYYBBZZ" ) + '"'
|
||||
? ' wordonly("AABBCCDD", "XXAAYYBBZZ") == "AABB" ? --> "' + WordOnly( "AABBCCDD", "XXAAYYBBZZ" ) + '"'
|
||||
? ' wordonly("AABBCCDD", "XAAYYYBBZZ") == "BB" ? ----> "' + WordOnly( "AABBCCDD", "XAAYYYBBZZ" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of WORDONLY()"
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' wordrem("abcd", "0ab1cd") == "0ab1" ? ----> "' + wordrem( "abcd", "0ab1cd" ) + '"'
|
||||
? ' wordrem("abcd", "ab0cd1") == "0cd1" ? ----> "' + wordrem( "abcd", "ab0cd1" ) + '"'
|
||||
? ' wordrem("abcd", "0ab1cd") == "0ab1" ? ----> "' + WordRem( "abcd", "0ab1cd" ) + '"'
|
||||
? ' wordrem("abcd", "ab0cd1") == "0cd1" ? ----> "' + WordRem( "abcd", "ab0cd1" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of WORDREM()"
|
||||
|
||||
@@ -61,15 +61,15 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? " Simple tests:"
|
||||
? ' wordrepl("CC", "AABBCCDDEE", "XX") == "AABBXXDDEE"? --> "' + wordrepl( "CC", "AABBCCDDEE", "XX" ) + '"'
|
||||
? ' wordrepl("aa", "1aaaa", "ba") == "1abaa" ? ------> "' + wordrepl( "aa", "1aaaa", "ba" ) + '"'
|
||||
? ' wordrepl("aa", "1aaaa", "ba", .T.) == "1baba" ? ------> "' + wordrepl( "aa", "1aaaa", "ba", .T. ) + '"'
|
||||
? ' wordrepl("CC", "AABBCCDDEE", "XX") == "AABBXXDDEE"? --> "' + WordRepl( "CC", "AABBCCDDEE", "XX" ) + '"'
|
||||
? ' wordrepl("aa", "1aaaa", "ba") == "1abaa" ? ------> "' + WordRepl( "aa", "1aaaa", "ba" ) + '"'
|
||||
? ' wordrepl("aa", "1aaaa", "ba", .T.) == "1baba" ? ------> "' + WordRepl( "aa", "1aaaa", "ba", .T. ) + '"'
|
||||
?
|
||||
|
||||
? " Testing CSETATMUPA(.T.) with lMode==.T.:"
|
||||
csetatmupa( .T. )
|
||||
? ' wordrepl("aa", "1aaaa", "ba") == "1abaa" ? --> "' + wordrepl( "aa", "1aaaa", "ba" ) + '"'
|
||||
? ' wordrepl("aa", "1aaaa", "ba", .T.) == "1bbba" ? --> "' + wordrepl( "aa", "1aaaa", "ba", .T. ) + '"'
|
||||
CSetAtMupa( .T. )
|
||||
? ' wordrepl("aa", "1aaaa", "ba") == "1abaa" ? --> "' + WordRepl( "aa", "1aaaa", "ba" ) + '"'
|
||||
? ' wordrepl("aa", "1aaaa", "ba", .T.) == "1bbba" ? --> "' + WordRepl( "aa", "1aaaa", "ba", .T. ) + '"'
|
||||
?
|
||||
|
||||
? "End test of WORDREPL()"
|
||||
|
||||
@@ -61,8 +61,8 @@ PROCEDURE Main()
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' wordswap("1234567890") == "3412785690" ? --> "' + wordswap( "1234567890" ) + '"'
|
||||
? ' wordswap("1234567890", .T.) == "4321876590" ? --> "' + wordswap( "1234567890", .T. ) + '"'
|
||||
? ' wordswap("1234567890") == "3412785690" ? --> "' + WordSwap( "1234567890" ) + '"'
|
||||
? ' wordswap("1234567890", .T.) == "4321876590" ? --> "' + WordSwap( "1234567890", .T. ) + '"'
|
||||
?
|
||||
|
||||
? "End test of WORDSWAP()"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
DYNAMIC FBClose
|
||||
DYNAMIC FBCommit
|
||||
DYNAMIC FBConnect
|
||||
DYNAMIC FBCreateDb
|
||||
DYNAMIC FBCreateDB
|
||||
DYNAMIC FBError
|
||||
DYNAMIC FBExecute
|
||||
DYNAMIC FBFetch
|
||||
@@ -38,7 +38,7 @@ DYNAMIC FBGetData
|
||||
DYNAMIC FBQuery
|
||||
DYNAMIC FBRollback
|
||||
DYNAMIC FBStartTransaction
|
||||
DYNAMIC TFBquery
|
||||
DYNAMIC TFBQuery
|
||||
DYNAMIC TFBRow
|
||||
DYNAMIC TFBServer
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ METHOD Execute( cQuery ) CLASS TFbServer
|
||||
RETURN result
|
||||
|
||||
METHOD Query( cQuery ) CLASS TFbServer
|
||||
RETURN TFbQuery():New( ::db, cQuery, ::dialect )
|
||||
RETURN TFBQuery():New( ::db, cQuery, ::dialect )
|
||||
|
||||
METHOD TableExists( cTable ) CLASS TFbServer
|
||||
|
||||
@@ -242,7 +242,7 @@ METHOD ListTables() CLASS TFbServer
|
||||
|
||||
IF HB_ISARRAY( qry )
|
||||
DO WHILE FBFetch( qry ) == 0
|
||||
AAdd( result, FBGetdata( qry, 1 ) )
|
||||
AAdd( result, FBGetData( qry, 1 ) )
|
||||
ENDDO
|
||||
|
||||
FBFree( qry )
|
||||
@@ -373,8 +373,8 @@ METHOD Delete( oRow, cWhere ) CLASS TFbServer
|
||||
|
||||
cWhere := ""
|
||||
FOR i := 1 TO Len( aKeys )
|
||||
nField := oRow:Fieldpos( aKeys[ i ] )
|
||||
xField := oRow:Fieldget( nField )
|
||||
nField := oRow:FieldPos( aKeys[ i ] )
|
||||
xField := oRow:FieldGet( nField )
|
||||
|
||||
cWhere += aKeys[ i ] + "=" + DataToSql( xField )
|
||||
|
||||
@@ -407,7 +407,7 @@ METHOD Append( oRow ) CLASS TFbServer
|
||||
FOR i := 1 TO oRow:FCount()
|
||||
IF oRow:Changed( i )
|
||||
// Send only changed field
|
||||
cQuery += oRow:Fieldname( i ) + ","
|
||||
cQuery += oRow:FieldName( i ) + ","
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
@@ -441,8 +441,8 @@ METHOD Update( oRow, cWhere ) CLASS TFbServer
|
||||
|
||||
cWhere := ""
|
||||
FOR i := 1 TO Len( aKeys )
|
||||
nField := oRow:Fieldpos( aKeys[ i ] )
|
||||
xField := oRow:Fieldget( nField )
|
||||
nField := oRow:FieldPos( aKeys[ i ] )
|
||||
xField := oRow:FieldGet( nField )
|
||||
|
||||
cWhere += aKeys[ i ] + "=" + DataToSql( xField )
|
||||
|
||||
@@ -455,7 +455,7 @@ METHOD Update( oRow, cWhere ) CLASS TFbServer
|
||||
cQuery := "UPDATE " + aTables[ 1 ] + " SET "
|
||||
FOR i := 1 TO oRow:FCount()
|
||||
IF oRow:Changed( i )
|
||||
cQuery += oRow:Fieldname( i ) + " = " + DataToSql( oRow:FieldGet( i ) ) + ","
|
||||
cQuery += oRow:FieldName( i ) + " = " + DataToSql( oRow:FieldGet( i ) ) + ","
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
@@ -742,7 +742,7 @@ METHOD Getrow() CLASS TFbQuery
|
||||
aRow[ i ] := ::FieldGet( i )
|
||||
NEXT
|
||||
|
||||
result := TFbRow():New( aRow, ::aStruct, ::db, ::dialect, ::aTables )
|
||||
result := TFBRow():New( aRow, ::aStruct, ::db, ::dialect, ::aTables )
|
||||
ENDIF
|
||||
|
||||
RETURN result
|
||||
@@ -775,7 +775,7 @@ METHOD GetBlankRow() CLASS TFbQuery
|
||||
ENDSWITCH
|
||||
NEXT
|
||||
|
||||
result := TFbRow():New( aRow, ::aStruct, ::db, ::dialect, ::aTables )
|
||||
result := TFBRow():New( aRow, ::aStruct, ::db, ::dialect, ::aTables )
|
||||
ENDIF
|
||||
|
||||
RETURN result
|
||||
@@ -934,7 +934,7 @@ STATIC FUNCTION KeyField( aTables, db, dialect )
|
||||
|
||||
IF HB_ISARRAY( qry )
|
||||
DO WHILE FBFetch( qry ) == 0
|
||||
AAdd( aKeys, RTrim( FBGetdata( qry, 1 ) ) )
|
||||
AAdd( aKeys, RTrim( FBGetData( qry, 1 ) ) )
|
||||
ENDDO
|
||||
|
||||
FBFree( qry )
|
||||
@@ -1002,9 +1002,9 @@ STATIC FUNCTION StructConvert( aStru, db, dialect )
|
||||
|
||||
DO WHILE FBFetch( qry ) == 0
|
||||
AAdd( aDomains, { ;
|
||||
iif( FBGetdata( qry, 1 ) == NIL, "", FBGetdata( qry, 1 ) ), ;
|
||||
iif( FBGetdata( qry, 2 ) == NIL, "", FBGetdata( qry, 2 ) ), ;
|
||||
iif( FBGetdata( qry, 3 ) == NIL, "", FBGetdata( qry, 3 ) ) } )
|
||||
iif( FBGetData( qry, 1 ) == NIL, "", FBGetData( qry, 1 ) ), ;
|
||||
iif( FBGetData( qry, 2 ) == NIL, "", FBGetData( qry, 2 ) ), ;
|
||||
iif( FBGetData( qry, 3 ) == NIL, "", FBGetData( qry, 3 ) ) } )
|
||||
ENDDO
|
||||
|
||||
FBFree( qry )
|
||||
|
||||
@@ -22,16 +22,20 @@ PROCEDURE Main()
|
||||
LOCAL im, clone, rotated, rotatedEx, rescale, im2, im3
|
||||
LOCAL centerX, centerY, width, height
|
||||
|
||||
// LOCAL bmpinfoheader
|
||||
#if 0
|
||||
LOCAL bmpinfoheader
|
||||
LOCAL bkcolor
|
||||
LOCAL iccprofile
|
||||
LOCAL appo
|
||||
#endif
|
||||
LOCAL bmpinfo
|
||||
// LOCAL bkcolor
|
||||
// LOCAL iccprofile
|
||||
LOCAL nH, nLen, cStr
|
||||
// LOCAL appo
|
||||
|
||||
// ? "Press Alt-D + Enter to activate debug"
|
||||
// AltD( .T. )
|
||||
// Inkey( 0 )
|
||||
#if 0
|
||||
? "Press Alt-D + Enter to activate debug"
|
||||
AltD( .T. )
|
||||
Inkey( 0 )
|
||||
#endif
|
||||
AltD()
|
||||
// Check output directory
|
||||
IF ! hb_DirExists( IMAGES_OUT )
|
||||
@@ -43,8 +47,10 @@ PROCEDURE Main()
|
||||
|
||||
//
|
||||
|
||||
? "Set Error Message:", fi_SetOutPutMessage( fi_Error() )
|
||||
//? "Set Error Message:", fi_SetOutPutMessage( NIL )
|
||||
? "Set Error Message:", fi_SetOutputMessage( fi_Error() )
|
||||
#if 0
|
||||
? "Set Error Message:", fi_SetOutputMessage( NIL )
|
||||
#endif
|
||||
|
||||
? "Version :", fi_GetVersion()
|
||||
? "Copyright :", fi_GetCopyrightMessage()
|
||||
@@ -150,51 +156,56 @@ PROCEDURE Main()
|
||||
? "Create ERROR :"
|
||||
? "Save GIF ? :", fi_Save( FIF_GIF, im, IMAGES_OUT + "wrong.gif", 0 )
|
||||
|
||||
// ? ValToPrg( fi_GetInfoHeader( im ) )
|
||||
// bmpinfoheader:Buffer( fi_GetInfoHeader( im ), .T. )
|
||||
// bmpinfoheader:Pointer( fi_GetInfoHeader( im ) )
|
||||
// ? "Header :", ValToPrg( bmpinfoheader )
|
||||
// ? bmpinfoheader:SayMembers(" ", .T., .T. )
|
||||
#if 0
|
||||
? ValToPrg( fi_GetInfoHeader( im ) )
|
||||
bmpinfoheader:Buffer( fi_GetInfoHeader( im ), .T. )
|
||||
bmpinfoheader:Pointer( fi_GetInfoHeader( im ) )
|
||||
? "Header :", ValToPrg( bmpinfoheader )
|
||||
? bmpinfoheader:SayMembers( " ", .T., .T. )
|
||||
#endif
|
||||
|
||||
//bmpinfo:Pointer( fi_GetInfo( im ) )
|
||||
#if 0
|
||||
bmpinfo:Pointer( fi_GetInfo( im ) )
|
||||
bmpinfo := NIL // To fix warning
|
||||
? "Info :", ValToPrg( bmpinfo )
|
||||
// ? bmpinfo:SayMembers(" ", .T., .T. )
|
||||
? bmpinfo:SayMembers( " ", .T., .T. )
|
||||
? "-----------------------------------------------------"
|
||||
// ? ValType( bmpinfo:Devalue() )
|
||||
// Tracelog( "bmpinfoheader", ValToPrg( bmpinfoheader ), ;
|
||||
// infoheader:SayMembers(, .T.), bmpinfoheader:Value(), bmpinfoheader:DeValue(), hb_dumpvar( bmpinfoheader:Array() ), hb_dumpvar( bmpinfoheader:acMembers ) )
|
||||
|
||||
// appo := bkcolor:Value()
|
||||
// ? bkcolor:Pointer( fi_GetBackgroundColor( im ) )
|
||||
// ? fi_GetBackgroundColor( im, @bkcolor:Value() )
|
||||
// bkcolor:Buffer( appo )
|
||||
// ? bkcolor:SayMembers( " ", .T., .T. )
|
||||
? ValType( bmpinfo:Devalue() )
|
||||
TraceLog( "bmpinfoheader", ValToPrg( bmpinfoheader ), ;
|
||||
infoheader:SayMembers(, .T. ), bmpinfoheader:Value(), bmpinfoheader:DeValue(), hb_DumpVar( bmpinfoheader:Array() ), hb_DumpVar( bmpinfoheader:acMembers ) )
|
||||
|
||||
// bkcolor:rgbBlue := 205
|
||||
// ? fi_SetBackgroundColor( im, hb_String2Pointer( bkcolor:Value() ) )
|
||||
Tracelog( "line 168" )
|
||||
// ? fi_SetBackgroundColor( im, bkcolor:Value() )
|
||||
Tracelog( "line 170" )
|
||||
// ? bkcolor:SayMembers( " ", .T., .T. )
|
||||
Tracelog( "line 162" )
|
||||
// ? bkcolor:Pointer( fi_GetBackgroundColor( im ) )
|
||||
// ? fi_GetBackgroundColor( im, @bkcolor:Value() )
|
||||
// bkcolor:Buffer( appo )
|
||||
Tracelog( "line 176" )
|
||||
// ? bkcolor:SayMembers( " ", .T., .T. )
|
||||
appo := bkcolor:Value()
|
||||
? bkcolor:Pointer( fi_GetBackgroundColor( im ) )
|
||||
? fi_GetBackgroundColor( im, @bkcolor:Value() )
|
||||
bkcolor:Buffer( appo )
|
||||
? bkcolor:SayMembers( " ", .T., .T. )
|
||||
|
||||
Tracelog( "line 179" )
|
||||
// iccprofile:Pointer( fi_GetICCProfile( im ) )
|
||||
Tracelog( "line 181" )
|
||||
// ? "Header :", ValToPrg( iccprofile )
|
||||
Tracelog( "line 183" )
|
||||
// ? iccprofile:SayMembers( " ", .T., .T. )
|
||||
bkcolor:rgbBlue := 205
|
||||
? fi_SetBackgroundColor( im, hb_String2Pointer( bkcolor:Value() ) )
|
||||
TraceLog( "line 168" )
|
||||
? fi_SetBackgroundColor( im, bkcolor:Value() )
|
||||
TraceLog( "line 170" )
|
||||
? bkcolor:SayMembers( " ", .T., .T. )
|
||||
TraceLog( "line 162" )
|
||||
? bkcolor:Pointer( fi_GetBackgroundColor( im ) )
|
||||
? fi_GetBackgroundColor( im, @bkcolor:Value() )
|
||||
bkcolor:Buffer( appo )
|
||||
TraceLog( "line 176" )
|
||||
? bkcolor:SayMembers( " ", .T., .T. )
|
||||
|
||||
// bmpinfoheader:Reset()
|
||||
// appo := NIL
|
||||
// bmpinfoheader := NIL
|
||||
// hb_GCAll( .T. )
|
||||
TraceLog( "line 179" )
|
||||
iccprofile:Pointer( fi_GetICCProfile( im ) )
|
||||
TraceLog( "line 181" )
|
||||
? "Header :", ValToPrg( iccprofile )
|
||||
TraceLog( "line 183" )
|
||||
? iccprofile:SayMembers( " ", .T., .T. )
|
||||
|
||||
bmpinfoheader:Reset()
|
||||
appo := NIL
|
||||
bmpinfoheader := NIL
|
||||
hb_gcAll( .T. )
|
||||
#endif
|
||||
|
||||
? "Unload images from memory"
|
||||
fi_Unload( im )
|
||||
@@ -220,7 +231,7 @@ PROCEDURE Main()
|
||||
//
|
||||
|
||||
? "DeInitialise"
|
||||
fi_Deinitialise()
|
||||
fi_DeInitialise()
|
||||
|
||||
?
|
||||
? "Look at " + IMAGES_OUT + " folder for output images"
|
||||
|
||||
@@ -308,7 +308,9 @@ METHOD Draw8( cText ) CLASS TCode
|
||||
LOCAL lError := .F.
|
||||
LOCAL ii, jj
|
||||
|
||||
// LOCAL xParity
|
||||
#if 0
|
||||
LOCAL xParity
|
||||
#endif
|
||||
LOCAL nChkSum := 0
|
||||
LOCAL nChk := 0
|
||||
|
||||
@@ -323,7 +325,9 @@ METHOD Draw8( cText ) CLASS TCode
|
||||
|
||||
::positionX := iif( ::textfont == 0, 0, 10 )
|
||||
|
||||
// xParity := ::Parity[ 7 ]
|
||||
#if 0
|
||||
xParity := ::Parity[ 7 ]
|
||||
#endif
|
||||
|
||||
// First Bar
|
||||
::positionX := 10
|
||||
@@ -427,7 +431,6 @@ METHOD Draw128( cText, cModeCode ) CLASS TCode
|
||||
LOCAL nC := 0
|
||||
LOCAL nPos
|
||||
|
||||
// LOCAL value_test := 0
|
||||
LOCAL lTypeCodeC := .F.
|
||||
LOCAL lTypeCodeA := .F.
|
||||
LOCAL lError := .F.
|
||||
@@ -594,8 +597,6 @@ METHOD GenCodei25() CLASS TCode
|
||||
LOCAL lError := .F.
|
||||
LOCAL bc_string
|
||||
|
||||
// LOCAL new_string := ""
|
||||
|
||||
IF ( Len( ::text ) % 2 ) != 0
|
||||
::DrawError( "Invalid barcode lenght" )
|
||||
lError := .T.
|
||||
|
||||
@@ -457,8 +457,7 @@ METHOD VerticalBarChart() CLASS GDChart
|
||||
METHOD HorizontalBarChart() CLASS GDChart
|
||||
|
||||
LOCAL hElement, nTot := 0
|
||||
// LOCAL nDegree := 0
|
||||
LOCAL lFilled, /*lExtruded, nExtrude,*/ pTile
|
||||
LOCAL lFilled, /* lExtruded, nExtrude, */ pTile
|
||||
LOCAL colorp
|
||||
LOCAL nVal, nDim
|
||||
LOCAL nPosX, nPosY
|
||||
@@ -615,9 +614,9 @@ METHOD HorizontalBarChart() CLASS GDChart
|
||||
// nExtrude := __HGetValue( hElement, "EXTRUDE" )
|
||||
pTile := __HGetValue( hElement, "TILE" )
|
||||
// IF nExtrude != NIL
|
||||
// lExtruded := .T.
|
||||
// lExtruded := .T.
|
||||
// ELSE
|
||||
// lExtruded := .F.
|
||||
// lExtruded := .F.
|
||||
// ENDIF
|
||||
colorp := __HGetValue( hElement, "COLOR" )
|
||||
nVal := hElement[ "VALUE" ]
|
||||
@@ -652,8 +651,7 @@ METHOD HorizontalBarChart() CLASS GDChart
|
||||
METHOD LineChart() CLASS GDChart
|
||||
|
||||
LOCAL hElement
|
||||
// LOCAL nDegree := 0
|
||||
LOCAL /*lFilled, lExtruded, nExtrude,*/ pTile
|
||||
LOCAL /* lFilled, lExtruded, nExtrude, */ pTile
|
||||
LOCAL colorp
|
||||
LOCAL nVal, nDim
|
||||
LOCAL nPosX, nPosY
|
||||
@@ -794,8 +792,8 @@ METHOD LineChart() CLASS GDChart
|
||||
|
||||
nCeiling := 10 ^ nCeiling
|
||||
|
||||
nMaxValue := ceiling( nMaxValue / nCeiling ) * nCeiling
|
||||
nMinValue := iif( nMinValue < 0, -ceiling( Abs( nMinValue ) / nCeiling ) * nCeiling, ceiling( nMinValue / nCeiling ) * nCeiling )
|
||||
nMaxValue := Ceiling( nMaxValue / nCeiling ) * nCeiling
|
||||
nMinValue := iif( nMinValue < 0, -Ceiling( Abs( nMinValue ) / nCeiling ) * nCeiling, Ceiling( nMinValue / nCeiling ) * nCeiling )
|
||||
|
||||
nTotRange := nMaxValue + iif( nMinValue < 0, Abs( nMinValue ), 0 )
|
||||
|
||||
|
||||
@@ -86,21 +86,21 @@ CREATE CLASS GDImage
|
||||
// Load From File
|
||||
METHOD LoadFromPng( cFile ) INLINE ::pImage := gdImageCreateFromPng( cFile ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD LoadFromJpeg( cFile ) INLINE ::pImage := gdImageCreateFromJpeg( cFile ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD LoadFromWBmp( cFile ) INLINE ::pImage := gdImageCreateFromWBMP( cFile ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD LoadFromWBmp( cFile ) INLINE ::pImage := gdImageCreateFromWBmp( cFile ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD LoadFromGd( cFile ) INLINE ::pImage := gdImageCreateFromGD( cFile ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD LoadFromGif( cFile ) INLINE ::pImage := gdImageCreateFromGif( cFile ) , iif( ::pImage != NIL, Self, NIL )
|
||||
|
||||
// Load From a specific File handle
|
||||
METHOD InputPng( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromPng( nHandle, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD InputJpeg( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromJpeg( nHandle, nSize ), iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD InputWBmp( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromWBMP( nHandle, nSize ), iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD InputWBmp( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromWBmp( nHandle, nSize ), iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD InputGd( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromGD( nHandle, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD InputGif( nHandle, nSize ) INLINE ::pImage := gdImageCreateFromGif( nHandle, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
|
||||
// Create from an image pointer in memory
|
||||
METHOD CreateFromPng( pImage, nSize ) INLINE ::pImage := gdImageCreateFromPng( pImage, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD CreateFromJpeg( pImage, nSize ) INLINE ::pImage := gdImageCreateFromJpeg( pImage, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD CreateFromWBmp( pImage, nSize ) INLINE ::pImage := gdImageCreateFromWBMP( pImage, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD CreateFromWBmp( pImage, nSize ) INLINE ::pImage := gdImageCreateFromWBmp( pImage, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD CreateFromGd( pImage, nSize ) INLINE ::pImage := gdImageCreateFromGD( pImage, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
METHOD CreateFromGif( pImage, nSize ) INLINE ::pImage := gdImageCreateFromGif( pImage, nSize ) , iif( ::pImage != NIL, Self, NIL )
|
||||
|
||||
@@ -128,7 +128,7 @@ CREATE CLASS GDImage
|
||||
METHOD ToStringPng( nLevel ) INLINE gdImagePng( ::pImage, NIL, nLevel )
|
||||
METHOD ToStringJpeg( nLevel ) INLINE gdImageJpeg( ::pImage, NIL, nLevel )
|
||||
METHOD ToStringWBmp( nFG ) INLINE gdImageWBmp( ::pImage, NIL, nFG )
|
||||
METHOD ToStringGd() INLINE gdImageGd( ::pImage, NIL )
|
||||
METHOD ToStringGd() INLINE gdImageGD( ::pImage, NIL )
|
||||
METHOD ToStringGif() INLINE gdImageGif( ::pImage, NIL )
|
||||
|
||||
METHOD ToString() INLINE gdImageToString( Self )
|
||||
@@ -368,7 +368,7 @@ METHOD LoadFromFile( cFile ) CLASS GDImage
|
||||
LOCAL aLoad
|
||||
|
||||
aLoad := gdImageFromFile( cFile )
|
||||
//Self := aLoad[ 1 ]:Clone()
|
||||
// Self := aLoad[ 1 ]:Clone()
|
||||
::Destroy()
|
||||
Self := ::CloneDataFrom( aLoad[ 1 ] )
|
||||
// Self := __objClone( aLoad[1] )
|
||||
@@ -557,8 +557,8 @@ METHOD Rotate( nAngle, lInside ) CLASS GDImage
|
||||
hb_default( @lInside, .F. )
|
||||
|
||||
IF ! lInside
|
||||
nWidth := ::Width * cos( nAngRad ) + ::Height * sin( nAngRad )
|
||||
nHeight := ::Width * sin( nAngRad ) + ::Height * cos( nAngRad )
|
||||
nWidth := ::Width * Cos( nAngRad ) + ::Height * Sin( nAngRad )
|
||||
nHeight := ::Width * Sin( nAngRad ) + ::Height * Cos( nAngRad )
|
||||
ELSE
|
||||
nWidth := ::Width
|
||||
nHeight := ::Height
|
||||
|
||||
@@ -130,7 +130,7 @@ DYNAMIC gdImageToString
|
||||
DYNAMIC gdImageTrueColor
|
||||
DYNAMIC gdImageTrueColorPixel
|
||||
DYNAMIC gdImageTrueColorToPalette
|
||||
DYNAMIC gdImageWBMP
|
||||
DYNAMIC gdImageWBmp
|
||||
DYNAMIC gdTrueColor
|
||||
DYNAMIC gdTrueColorAlpha
|
||||
DYNAMIC gdVersion
|
||||
|
||||
@@ -14,17 +14,19 @@ PROCEDURE Main()
|
||||
LOCAL black := { 0, 0, 0 }
|
||||
LOCAL white := { 255, 255, 255 }
|
||||
|
||||
// LOCAL blue := { 0, 0, 255 }
|
||||
// LOCAL yellon := { 255, 255, 128 }
|
||||
#if 0
|
||||
LOCAL blue := { 0, 0, 255 }
|
||||
LOCAL yellon := { 255, 255, 128 }
|
||||
|
||||
// LOCAL red := { 255, 0, 0 }
|
||||
LOCAL red := { 255, 0, 0 }
|
||||
|
||||
LOCAL nlower := 1, nhight := 50
|
||||
#endif
|
||||
|
||||
LOCAL ccode13 := "P48WBQ7BX3M73X8V3WRT7F9JW"
|
||||
LOCAL ccode8 := "P48WBQ7BX3M73X8V3WRT7F9JW"
|
||||
LOCAL ccode128 := "P48WBQ7BX3M73X8V3WRT7F9JW"
|
||||
|
||||
// LOCAL nlower := 1, nhight := 50
|
||||
|
||||
/* here is the list of arguments
|
||||
1- Barcode Type 13,8 and 128
|
||||
*/
|
||||
|
||||
@@ -14,18 +14,20 @@ PROCEDURE Main()
|
||||
LOCAL black := { 0, 0, 0 }
|
||||
LOCAL white := { 255, 255, 255 }
|
||||
|
||||
// LOCAL blue := { 0, 0, 255 }
|
||||
// LOCAL yellon := { 255, 255, 128 }
|
||||
#if 0
|
||||
LOCAL blue := { 0, 0, 255 }
|
||||
LOCAL yellon := { 255, 255, 128 }
|
||||
|
||||
// LOCAL red := { 255, 0, 0 }
|
||||
LOCAL red := { 255, 0, 0 }
|
||||
|
||||
LOCAL nlower := 1, nhight := 50
|
||||
#endif
|
||||
|
||||
LOCAL ccode13 := "789136043666"
|
||||
LOCAL ccode8 := "0421000"
|
||||
// LOCAL ccode128 := "00011005100000000"
|
||||
// LOCAL ccode128 := "00011005100000000"
|
||||
LOCAL ccode128 := "Code 128"
|
||||
|
||||
// LOCAL nlower := 1, nhight := 50
|
||||
|
||||
/* here is the list of arguments
|
||||
1- Barcode Type 13,8 and 128
|
||||
*/
|
||||
@@ -55,7 +57,7 @@ PROCEDURE Main()
|
||||
bar:Finish( 2 )
|
||||
|
||||
// EAN8
|
||||
bar:= TCode():New( 8 )
|
||||
bar := TCode():New( 8 )
|
||||
|
||||
bar:Configure( 70, black, white, 2, 1 )
|
||||
|
||||
@@ -68,7 +70,7 @@ PROCEDURE Main()
|
||||
bar:ResizeImage()
|
||||
|
||||
// EAN128
|
||||
bar:= TCode():New( 128 )
|
||||
bar := TCode():New( 128 )
|
||||
|
||||
bar:Configure( 50, black, white, 2, 1 )
|
||||
|
||||
|
||||
@@ -28,12 +28,14 @@ PROCEDURE Main( cValue, cBaseImage )
|
||||
|
||||
LOCAL oI, oIDigits, nWidth, nHeight, nDigits, nNumWidth, oTemp
|
||||
|
||||
// LOCAL black, blue, red, green, cyan, gray
|
||||
#if 0
|
||||
LOCAL black, blue, red, green, cyan, gray
|
||||
#endif
|
||||
LOCAL aNumberImages := {}
|
||||
LOCAL n, nValue
|
||||
|
||||
// A value if not passed
|
||||
hb_default( @cValue , Str( hb_RandomInt( 1, 10 ^ DISPLAY_NUM ), DISPLAY_NUM ) )
|
||||
hb_default( @cValue, Str( hb_RandomInt( 1, 10 ^ DISPLAY_NUM ), DISPLAY_NUM ) )
|
||||
hb_default( @cBaseImage, "57chevy.gif" )
|
||||
|
||||
IF ! hb_FileExists( IMAGES_IN + cBaseImage )
|
||||
@@ -53,11 +55,11 @@ PROCEDURE Main( cValue, cBaseImage )
|
||||
? "Value = ", cValue
|
||||
|
||||
// Check output directory
|
||||
/*
|
||||
#if 0
|
||||
IF ! hb_DirExists( IMAGES_OUT )
|
||||
DirMake( IMAGES_OUT )
|
||||
ENDIF
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* Load a digits image in memory from file */
|
||||
oIDigits := GDImage():LoadFromGif( IMAGES_IN + cBaseImage )
|
||||
@@ -97,14 +99,16 @@ PROCEDURE Main( cValue, cBaseImage )
|
||||
? "Image dimensions: ", oI:Width(), oI:Height()
|
||||
|
||||
/* Allocate drawing color */
|
||||
// black := oI:SetColor( 0, 0, 0 )
|
||||
// blue := oI:SetColor( 0, 0, 255 )
|
||||
// red := oI:SetColor( 255, 0, 0 )
|
||||
// green := oI:SetColor( 0, 255, 0 )
|
||||
// cyan := oI:SetColor( 0, 255, 255 )
|
||||
#if 0
|
||||
black := oI:SetColor( 0, 0, 0 )
|
||||
blue := oI:SetColor( 0, 0, 255 )
|
||||
red := oI:SetColor( 255, 0, 0 )
|
||||
green := oI:SetColor( 0, 255, 0 )
|
||||
cyan := oI:SetColor( 0, 255, 255 )
|
||||
|
||||
/* Draw rectangle */
|
||||
// oI:Rectangle( 0, 0, 200, 30, , blue )
|
||||
oI:Rectangle( 0, 0, 200, 30, , blue )
|
||||
#endif
|
||||
|
||||
/* Draw Digits */
|
||||
FOR n := 1 TO Len( cValue )
|
||||
|
||||
@@ -78,7 +78,7 @@ PROCEDURE Main()
|
||||
gdImageStringUp( im, font, 70, 15, "P", black )
|
||||
gdImageCharUp( im, font, 70, 30, "W", black )
|
||||
|
||||
gdImageStringFt( im, blue, "arial", 20, 30, 20, 90, "Test" )
|
||||
gdImageStringFT( im, blue, "arial", 20, 30, 20, 90, "Test" )
|
||||
|
||||
? gdImageStringFTCircle( im, 120, 120, 50, 25, 0.8, "arial", 24, "Up", /*"Down"*/, red )
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ PROCEDURE Main()
|
||||
oI:SetFontLarge()
|
||||
? "Font Dims", oI:GetFontWidth(), oI:GetFontHeight()
|
||||
oI:SetColor( black )
|
||||
//__OutDebug( "Font", font )
|
||||
oI:Say( 0, 0, "Test" )
|
||||
oI:Say( 0, 15, "P" )
|
||||
oI:Say( 0, 30, "W" )
|
||||
@@ -168,19 +167,19 @@ PROCEDURE Main()
|
||||
|
||||
// oI4:SetColor( black )
|
||||
// oI4:Say( 100, 10, "Valentina" )
|
||||
#if defined( __PLATFORM__UNIX )
|
||||
oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD power", "arib____", 40, 45 )
|
||||
#else
|
||||
nSecs := Seconds()
|
||||
? "start write"
|
||||
FOR n := 0 TO 350 STEP 10
|
||||
oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), " GD Font Power", "arial", 20, n )
|
||||
NEXT
|
||||
? "end", Seconds() - nSecs
|
||||
oI4:SetTransparent( blue )
|
||||
oI4:SayFreeType( oI4:CenterWidth() - 4, oI4:CenterHeight() + 4, "GD", "verdana", 70, n, gray )
|
||||
oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD", "verdana", 70, n, blue )
|
||||
#endif
|
||||
#if defined( __PLATFORM__UNIX )
|
||||
oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD power", "arib____", 40, 45 )
|
||||
#else
|
||||
nSecs := Seconds()
|
||||
? "start write"
|
||||
FOR n := 0 TO 350 STEP 10
|
||||
oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), " GD Font Power", "arial", 20, n )
|
||||
NEXT
|
||||
? "end", Seconds() - nSecs
|
||||
oI4:SetTransparent( blue )
|
||||
oI4:SayFreeType( oI4:CenterWidth() - 4, oI4:CenterHeight() + 4, "GD", "verdana", 70, n, gray )
|
||||
oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD", "verdana", 70, n, blue )
|
||||
#endif
|
||||
oI4:SaveJpeg( IMAGES_OUT + "writing.jpg" )
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,9 @@ PROCEDURE Main( ... )
|
||||
|
||||
LOCAL cImg, nPt, nWidth, nHeight, cPhoto
|
||||
|
||||
// LOCAL cText
|
||||
#if 0
|
||||
LOCAL cText
|
||||
#endif
|
||||
|
||||
IF Empty( aParams )
|
||||
IF ! Empty( cQuery )
|
||||
@@ -61,21 +63,27 @@ PROCEDURE Main( ... )
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
// __OutDebug( cQuery, ValToPrg( hParams ) )
|
||||
// __OutDebug( cQuery, ValToPrg( hParams ) )
|
||||
|
||||
// hb_default( @cText, "Testo di Prova" )
|
||||
#if 0
|
||||
hb_default( @cText, "Testo di Prova" )
|
||||
#endif
|
||||
hb_default( @nPt, 30 )
|
||||
|
||||
IF cImg != NIL
|
||||
// OutJpg( cImg, nPt )
|
||||
#if 0
|
||||
OutJpg( cImg, nPt )
|
||||
#endif
|
||||
OutPhoto( cImg, nWidth, nHeight )
|
||||
|
||||
ELSEIF cPhoto != NIL
|
||||
StartHTML()
|
||||
// OutHTML ValToPrg( hParams ) + "<br>"
|
||||
// OutHTML ValToPrg( cParams ) + "<br>"
|
||||
// OutHTML ValToPrg( cQuery ) + "<br>"
|
||||
// OutHTML "<img src='test_out.exe?img=" + cPhoto + "&width=" + hb_ntos( nWidth ) + "&height=" + hb_ntos( nHeight ) + "'>" + "<br>"
|
||||
#if 0
|
||||
OutHTML ValToPrg( hParams ) + "<br>"
|
||||
OutHTML ValToPrg( cParams ) + "<br>"
|
||||
OutHTML ValToPrg( cQuery ) + "<br>"
|
||||
OutHTML "<img src='test_out.exe?img=" + cPhoto + "&width=" + hb_ntos( nWidth ) + "&height=" + hb_ntos( nHeight ) + "'>" + "<br>"
|
||||
#endif
|
||||
OutHTML "<table border=1>"
|
||||
OutHTML "<tr><td align='center'>"
|
||||
OutHTML "<img src='test_out.exe?img=" + cPhoto + "'>" + "<br>"
|
||||
@@ -91,8 +99,10 @@ PROCEDURE Main( ... )
|
||||
OutHTML "</td></tr>"
|
||||
OutHTML "</table>"
|
||||
OutHTML "<br>"
|
||||
// OutHTML "<img src='test_out.exe?img=" + cText + "_2&pt=" + hb_ntos( nPt ) + "'>" + "<br>"
|
||||
// OutHTML OS() + "<br>"
|
||||
#if 0
|
||||
OutHTML "<img src='test_out.exe?img=" + cText + "_2&pt=" + hb_ntos( nPt ) + "'>" + "<br>"
|
||||
OutHTML OS() + "<br>"
|
||||
#endif
|
||||
EndHTML()
|
||||
ELSE
|
||||
StartHTML()
|
||||
@@ -139,7 +149,9 @@ PROCEDURE OutPhoto( cPhoto, nWidth, nHeight )
|
||||
oImage:Resize( nWidth, nHeight )
|
||||
ENDIF
|
||||
|
||||
// __OutDebug( hb_dumpvar( oImage ) )
|
||||
#if 0
|
||||
__OutDebug( hb_DumpVar( oImage ) )
|
||||
#endif
|
||||
|
||||
WRITE "content-type: " + oImage:cMime + hb_eol()
|
||||
cType := oImage:cType
|
||||
@@ -159,7 +171,7 @@ PROCEDURE OutJpg( cText, nPitch )
|
||||
|
||||
LOCAL oI
|
||||
|
||||
// LOCAL cyan
|
||||
// LOCAL cyan
|
||||
LOCAL blue
|
||||
LOCAL aSize, nWidth, nHeight, nX, nY
|
||||
|
||||
@@ -169,16 +181,21 @@ PROCEDURE OutJpg( cText, nPitch )
|
||||
/* Create an image in memory */
|
||||
oI := GDImage( 400, 100 )
|
||||
|
||||
#if 0
|
||||
/* Allocate background */
|
||||
// cyan := oI:SetColor( 0, 255, 255 )
|
||||
cyan := oI:SetColor( 0, 255, 255 )
|
||||
|
||||
/* Allocate drawing color */
|
||||
// blue := oI:SetColor( 0, 0, 200 )
|
||||
blue := oI:SetColor( 0, 0, 200 )
|
||||
|
||||
oI:SetTransparent( blue )
|
||||
#endif
|
||||
|
||||
// oI:SetTransparent( blue )
|
||||
oI:SetFontName( "Verdana" ) // TOFIX
|
||||
oI:SetFontPitch( nPitch )
|
||||
// __OutDebug( oI:GetFTFontHeight() )
|
||||
#endif
|
||||
__OutDebug( oI:GetFTFontHeight() )
|
||||
#endif
|
||||
aSize := oI:GetFTStringSize( cText )
|
||||
nWidth := aSize[ 1 ]
|
||||
nHeight := aSize[ 2 ]
|
||||
@@ -192,16 +209,18 @@ PROCEDURE OutJpg( cText, nPitch )
|
||||
oI:SetFontName( "Verdana" ) // TOFIX
|
||||
oI:SetFontPitch( nPitch )
|
||||
oI:SayFreeType( 0 - nX, 0 + nHeight - nY, cText, , , 0, blue )
|
||||
// oI:SayFreeType( 0, 0, cText, , , 0, blue )
|
||||
#endif
|
||||
oI:SayFreeType( 0, 0, cText, , , 0, blue )
|
||||
|
||||
// oI:Resize( nWidth, nHeight )
|
||||
// __OutDebug( "prima", oI:Width(), oI:Height() )
|
||||
// oI:Resize( 60, 40 )
|
||||
// __OutDebug( "dopo", oI:Width(), oI:Height() )
|
||||
oI:Resize( nWidth, nHeight )
|
||||
__OutDebug( "prima", oI:Width(), oI:Height() )
|
||||
oI:Resize( 60, 40 )
|
||||
__OutDebug( "dopo", oI:Width(), oI:Height() )
|
||||
|
||||
// oI:SetFontLarge()
|
||||
// oI:SetColor( blue )
|
||||
// oI:Say( 0, 0, cText )
|
||||
oI:SetFontLarge()
|
||||
oI:SetColor( blue )
|
||||
oI:Say( 0, 0, cText )
|
||||
#endif
|
||||
|
||||
WRITE "content-type: image/jpeg" + hb_eol()
|
||||
|
||||
@@ -243,7 +262,7 @@ FUNCTION GetVars( cFields, cSeparator )
|
||||
ENDIF
|
||||
// Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue )
|
||||
NEXT
|
||||
// __OutDebug( hHashVars )
|
||||
// __OutDebug( hHashVars )
|
||||
|
||||
RETURN hHashVars
|
||||
|
||||
@@ -279,11 +298,11 @@ FUNCTION GetParams( aParams )
|
||||
ENDIF
|
||||
// Tracelog( "hHashVars, cName, xValue", DumpValue( hHashVars ), cName, xValue )
|
||||
NEXT
|
||||
// __OutDebug( hHashVars )
|
||||
// __OutDebug( hHashVars )
|
||||
|
||||
RETURN hHashVars
|
||||
|
||||
//***********************************************************
|
||||
// ***********************************************************
|
||||
// Decoding URL
|
||||
// Can return both a string or a number
|
||||
//
|
||||
@@ -292,7 +311,7 @@ FUNCTION URLDecode( cStr )
|
||||
|
||||
LOCAL cRet := "", i, cCar
|
||||
|
||||
// LOCAL lNumeric := .T.
|
||||
// LOCAL lNumeric := .T.
|
||||
|
||||
FOR i := 1 TO Len( cStr )
|
||||
cCar := cStr[ i ]
|
||||
@@ -316,9 +335,9 @@ FUNCTION URLDecode( cStr )
|
||||
// ENDIF
|
||||
NEXT
|
||||
|
||||
// IF lNumeric
|
||||
// cRet := Val( cRet )
|
||||
// ENDIF
|
||||
// IF lNumeric
|
||||
// cRet := Val( cRet )
|
||||
// ENDIF
|
||||
|
||||
RETURN cRet
|
||||
|
||||
|
||||
@@ -92,10 +92,10 @@ PROCEDURE DrawFlake( lOpenPoly )
|
||||
PROCEDURE KochFlake( nOrder, nSideLen, lLeftFirst )
|
||||
|
||||
IF nOrder == 0
|
||||
AAdd( s_aCoords, {;
|
||||
s_nCoordX += Cos( s_nAngle ) * nSideLen,;
|
||||
s_nCoordY += Sin( s_nAngle ) * nSideLen;
|
||||
})
|
||||
AAdd( s_aCoords, { ;
|
||||
s_nCoordX += Cos( s_nAngle ) * nSideLen, ;
|
||||
s_nCoordY += Sin( s_nAngle ) * nSideLen;
|
||||
} )
|
||||
ELSE
|
||||
KochFlake( nOrder - 1, nSideLen / 3, lLeftFirst )
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
STATIC s_hDLL := { => }
|
||||
STATIC s_mutex := hb_mutexCreate()
|
||||
|
||||
PROCEDURE UNLOADALLDLL()
|
||||
PROCEDURE UnloadAllDll()
|
||||
|
||||
hb_mutexLock( s_mutex )
|
||||
s_hDLL := { => }
|
||||
@@ -63,8 +63,8 @@ PROCEDURE UNLOADALLDLL()
|
||||
|
||||
RETURN
|
||||
|
||||
FUNCTION CALLDLL32( cFunction, cLibrary, ... )
|
||||
RETURN HB_DYNACALL1( cFunction, cLibrary, NIL, ... )
|
||||
FUNCTION CallDll32( cFunction, cLibrary, ... )
|
||||
RETURN hb_DynaCall1( cFunction, cLibrary, NIL, ... )
|
||||
|
||||
#if define( __PLATFORM__WINDOWS )
|
||||
/* Use Windows system .dll calling convention on Windows systems,
|
||||
@@ -75,7 +75,7 @@ FUNCTION CALLDLL32( cFunction, cLibrary, ... )
|
||||
# define _DEF_CALLCONV_ HB_DYN_CALLCONV_CDECL
|
||||
#endif
|
||||
|
||||
FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... )
|
||||
FUNCTION hb_DynaCall1( cFunction, cLibrary, nCount, ... )
|
||||
|
||||
LOCAL aParams
|
||||
LOCAL hHandle
|
||||
@@ -103,8 +103,8 @@ FUNCTION HB_DYNACALL1( cFunction, cLibrary, nCount, ... )
|
||||
|
||||
RETURN NIL
|
||||
|
||||
FUNCTION STRPTR( x )
|
||||
FUNCTION StrPtr( x )
|
||||
RETURN x
|
||||
|
||||
FUNCTION PTRSTR( x )
|
||||
FUNCTION PtrStr( x )
|
||||
RETURN x
|
||||
|
||||
@@ -148,8 +148,8 @@ STATIC FUNCTION FCM_OPEN( nWA, aOpenInfo )
|
||||
RETURN HB_FAILURE
|
||||
ENDIF
|
||||
|
||||
HB_FSELECT( nSlot )
|
||||
nHandle := HB_FUSE( aOpenInfo[ UR_OI_NAME ], nMode )
|
||||
hb_FSelect( nSlot )
|
||||
nHandle := hb_FUse( aOpenInfo[ UR_OI_NAME ], nMode )
|
||||
IF nHandle == -1
|
||||
oError := ErrorNew()
|
||||
oError:GenCode := EG_OPEN
|
||||
@@ -190,8 +190,8 @@ STATIC FUNCTION FCM_CLOSE( nWA )
|
||||
LOCAL aRData, nSlot := USRRDD_AREADATA( nWA )[ 1 ]
|
||||
|
||||
IF nSlot >= 0
|
||||
HB_FSELECT( nSlot )
|
||||
HB_FUSE()
|
||||
hb_FSelect( nSlot )
|
||||
hb_FUse()
|
||||
aRData := USRRDD_RDDDATA( USRRDD_ID( nWA ) )
|
||||
aRData[ nSlot ] := -1
|
||||
ENDIF
|
||||
@@ -207,8 +207,8 @@ STATIC FUNCTION FCM_GETVALUE( nWA, nField, xValue )
|
||||
/* We are at EOF position, return empty value */
|
||||
xValue := ""
|
||||
ELSE
|
||||
HB_FSELECT( aWData[ 1 ] )
|
||||
xValue := HB_FREADLN()
|
||||
hb_FSelect( aWData[ 1 ] )
|
||||
xValue := hb_FReadLn()
|
||||
ENDIF
|
||||
RETURN HB_SUCCESS
|
||||
ENDIF
|
||||
@@ -219,17 +219,17 @@ STATIC FUNCTION FCM_GOTO( nWA, nRecord )
|
||||
|
||||
LOCAL aWData := USRRDD_AREADATA( nWA )
|
||||
|
||||
HB_FSELECT( aWData[ 1 ] )
|
||||
hb_FSelect( aWData[ 1 ] )
|
||||
IF nRecord <= 0
|
||||
aWData[ 2 ] := aWData[ 3 ] := .T.
|
||||
ELSEIF nRecord == 1
|
||||
HB_FGOTOP()
|
||||
hb_FGoTop()
|
||||
aWData[ 2 ] := aWData[ 3 ] := hb_FEof()
|
||||
ELSE
|
||||
HB_FSKIP( 0 ) /* Clear the EOF flag inside HB_F* engin
|
||||
hb_FSkip( 0 ) /* Clear the EOF flag inside HB_F* engin
|
||||
- it's not done automatically in HB_FGOBOTTOM() :-( */
|
||||
HB_FGOTO( nRecord )
|
||||
aWData[ 2 ] := HB_FRECNO() == 0
|
||||
hb_FGoto( nRecord )
|
||||
aWData[ 2 ] := hb_FRecNo() == 0
|
||||
aWData[ 3 ] := hb_FEof()
|
||||
ENDIF
|
||||
|
||||
@@ -242,8 +242,8 @@ STATIC FUNCTION FCM_GOTOP( nWA )
|
||||
|
||||
LOCAL aWData := USRRDD_AREADATA( nWA )
|
||||
|
||||
HB_FSELECT( aWData[ 1 ] )
|
||||
HB_FGOTOP()
|
||||
hb_FSelect( aWData[ 1 ] )
|
||||
hb_FGoTop()
|
||||
aWData[ 2 ] := aWData[ 3 ] := hb_FEof()
|
||||
|
||||
RETURN HB_SUCCESS
|
||||
@@ -252,13 +252,13 @@ STATIC FUNCTION FCM_GOBOTTOM( nWA )
|
||||
|
||||
LOCAL aWData := USRRDD_AREADATA( nWA )
|
||||
|
||||
HB_FSELECT( aWData[ 1 ] )
|
||||
IF HB_FLASTREC() == 0
|
||||
hb_FSelect( aWData[ 1 ] )
|
||||
IF hb_FLastRec() == 0
|
||||
aWData[ 2 ] := aWData[ 3 ] := .T.
|
||||
ELSE
|
||||
HB_FSKIP( 0 ) /* Clear the EOF flag inside HB_F* engin
|
||||
hb_FSkip( 0 ) /* Clear the EOF flag inside HB_F* engin
|
||||
- it's not done automatically in HB_FGOBOTTOM() :-( */
|
||||
HB_FGOBOTTOM()
|
||||
hb_FGoBottom()
|
||||
aWData[ 2 ] := aWData[ 3 ] := .F.
|
||||
ENDIF
|
||||
|
||||
@@ -270,7 +270,7 @@ STATIC FUNCTION FCM_SKIPRAW( nWA, nRecords )
|
||||
|
||||
IF nRecords != 0
|
||||
aWData := USRRDD_AREADATA( nWA )
|
||||
HB_FSELECT( aWData[ 1 ] )
|
||||
hb_FSelect( aWData[ 1 ] )
|
||||
IF aWData[ 3 ]
|
||||
IF nRecords > 0
|
||||
RETURN HB_SUCCESS
|
||||
@@ -278,12 +278,12 @@ STATIC FUNCTION FCM_SKIPRAW( nWA, nRecords )
|
||||
FCM_GOBOTTOM( nWA )
|
||||
++nRecords
|
||||
ENDIF
|
||||
IF nRecords < 0 .AND. HB_FRECNO() <= -nRecords
|
||||
HB_FGOTOP()
|
||||
IF nRecords < 0 .AND. hb_FRecNo() <= -nRecords
|
||||
hb_FGoTop()
|
||||
aWData[ 2 ] := .T.
|
||||
aWData[ 3 ] := hb_FEof()
|
||||
ELSEIF nRecords != 0
|
||||
HB_FSKIP( nRecords )
|
||||
hb_FSkip( nRecords )
|
||||
aWData[ 2 ] := .F.
|
||||
aWData[ 3 ] := hb_FEof()
|
||||
ENDIF
|
||||
@@ -318,19 +318,19 @@ STATIC FUNCTION FCM_RECID( nWA, nRecNo )
|
||||
|
||||
LOCAL aWData := USRRDD_AREADATA( nWA )
|
||||
|
||||
HB_FSELECT( aWData[ 1 ] )
|
||||
hb_FSelect( aWData[ 1 ] )
|
||||
IF aWData[ 3 ]
|
||||
nRecNo := HB_FLASTREC() + 1
|
||||
nRecNo := hb_FLastRec() + 1
|
||||
ELSE
|
||||
nRecNo := HB_FRECNO()
|
||||
nRecNo := hb_FRecNo()
|
||||
ENDIF
|
||||
|
||||
RETURN HB_SUCCESS
|
||||
|
||||
STATIC FUNCTION FCM_RECCOUNT( nWA, nRecords )
|
||||
|
||||
HB_FSELECT( USRRDD_AREADATA( nWA )[ 1 ] )
|
||||
nRecords := HB_FLASTREC()
|
||||
hb_FSelect( USRRDD_AREADATA( nWA )[ 1 ] )
|
||||
nRecords := hb_FLastRec()
|
||||
|
||||
RETURN HB_SUCCESS
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@ CREATE CLASS TFileRead
|
||||
VAR nError // The current file error code
|
||||
VAR nLastOp // The last operation done (for error messages)
|
||||
VAR cBuffer // The readahead buffer
|
||||
VAR nReadSize // How much to add to the readahead buffer on
|
||||
// each read from the file
|
||||
VAR nReadSize // How much to add to the readahead buffer on each read from the file
|
||||
|
||||
METHOD New( cFile, nSize ) // Create a new class instance
|
||||
METHOD Open( nMode ) // Open the file for reading
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
THREAD STATIC s_nESize := 4096 // default buffer size
|
||||
|
||||
//
|
||||
//03-06-93 07:52pm
|
||||
// 03-06-93 07:52pm
|
||||
//
|
||||
// nTop, nLeft, nBottom, nRight - position on the screen
|
||||
// nLength - the line length
|
||||
@@ -63,7 +63,7 @@ FUNCTION EditorNew( nTop, nLeft, nBottom, nRight, nLength, ;
|
||||
nLength := 80
|
||||
ENDIF
|
||||
|
||||
pEdit := ED_New( nLength, 4, IIFNIL( s_nESize, nSize ), nEscape )
|
||||
pEdit := ed_New( nLength, 4, IIFNIL( s_nESize, nSize ), nEscape )
|
||||
IF ! Empty( pEdit )
|
||||
oEdit := Array( E_STRUCT_LEN )
|
||||
oEdit[ E_EDIT ] := pEdit
|
||||
@@ -77,13 +77,13 @@ FUNCTION EditorNew( nTop, nLeft, nBottom, nRight, nLength, ;
|
||||
oEdit[ E_COLOR ] := IIFNIL( "W/N,W+/N,W+/R,GR+/N,G+/N", cColor )
|
||||
oEdit[ E_MODE ] := EDIT_VIEW
|
||||
|
||||
ED_Config( pEdit, nTop, nLeft, nBottom, nRight, 0, 0 )
|
||||
ed_Config( pEdit, nTop, nLeft, nBottom, nRight, 0, 0 )
|
||||
ENDIF
|
||||
|
||||
RETURN oEdit
|
||||
|
||||
//
|
||||
//03-06-93 09:16pm
|
||||
// 03-06-93 09:16pm
|
||||
//
|
||||
|
||||
PROCEDURE EditorKill( oEdit )
|
||||
@@ -93,7 +93,7 @@ PROCEDURE EditorKill( oEdit )
|
||||
RETURN
|
||||
|
||||
//
|
||||
//03-06-93 10:20pm
|
||||
// 03-06-93 10:20pm
|
||||
//
|
||||
|
||||
FUNCTION EditorCargo( oEdit, xCargo )
|
||||
@@ -107,7 +107,7 @@ FUNCTION EditorCargo( oEdit, xCargo )
|
||||
RETURN _xCargo
|
||||
|
||||
//
|
||||
//19-07-93 01:08am
|
||||
// 19-07-93 01:08am
|
||||
//
|
||||
|
||||
FUNCTION EditorTitle( oEdit, cTitle )
|
||||
@@ -121,7 +121,7 @@ FUNCTION EditorTitle( oEdit, cTitle )
|
||||
RETURN _cTitle
|
||||
|
||||
//
|
||||
//04-06-93 02:18am
|
||||
// 04-06-93 02:18am
|
||||
//
|
||||
// Sets
|
||||
// EDIT_EDIT - full edit mode
|
||||
@@ -139,7 +139,7 @@ FUNCTION EditorMode( oEdit, lMode )
|
||||
RETURN _lMode
|
||||
|
||||
//
|
||||
//28-05-92 09:31am
|
||||
// 28-05-92 09:31am
|
||||
//
|
||||
|
||||
FUNCTION EditorSize( nSize )
|
||||
@@ -153,45 +153,45 @@ FUNCTION EditorSize( nSize )
|
||||
RETURN _nSize
|
||||
|
||||
//
|
||||
//28-02-92 10:57pm
|
||||
// 28-02-92 10:57pm
|
||||
//
|
||||
// Appends passed text to the text already stored in editor
|
||||
//
|
||||
|
||||
PROCEDURE EditorAddText( oEdit, cText )
|
||||
|
||||
ED_AddText( oEdit[ E_EDIT ], cText )
|
||||
ed_AddText( oEdit[ E_EDIT ], cText )
|
||||
|
||||
RETURN
|
||||
|
||||
//
|
||||
//05-03-92 10:21pm
|
||||
// 05-03-92 10:21pm
|
||||
//
|
||||
// Sets new text in editor
|
||||
//
|
||||
|
||||
PROCEDURE EditorSetText( oEdit, cText )
|
||||
|
||||
ED_SetText( oEdit[ E_EDIT ], cText )
|
||||
ed_SetText( oEdit[ E_EDIT ], cText )
|
||||
|
||||
RETURN
|
||||
|
||||
//
|
||||
//05-03-92 10:23pm
|
||||
// 05-03-92 10:23pm
|
||||
//
|
||||
// Inserts passed text into editor starting from passed line number
|
||||
//
|
||||
|
||||
PROCEDURE EditorInsText( oEdit, cText, nLine )
|
||||
|
||||
LOCAL nNum := IIFNIL( ED_LCount( oEdit[ E_EDIT ] ), nLine )
|
||||
LOCAL nNum := IIFNIL( ed_LCount( oEdit[ E_EDIT ] ), nLine )
|
||||
|
||||
ED_InsText( oEdit[ E_EDIT ], cText, nNum )
|
||||
ed_InsText( oEdit[ E_EDIT ], cText, nNum )
|
||||
|
||||
RETURN
|
||||
|
||||
//
|
||||
//02-03-92 07:53pm
|
||||
// 02-03-92 07:53pm
|
||||
//
|
||||
// Retrieves the text from editor
|
||||
// nCarret - specifies if soft carriage return (141/10) should be replaced by
|
||||
@@ -204,30 +204,30 @@ FUNCTION EditorGetText( oEdit, nCarret )
|
||||
nCarret := EDIT_HARD
|
||||
ENDIF
|
||||
|
||||
RETURN ED_GetText( oEdit[ E_EDIT ], nCarret )
|
||||
RETURN ed_GetText( oEdit[ E_EDIT ], nCarret )
|
||||
|
||||
//
|
||||
//04-03-92 02:35pm
|
||||
// 04-03-92 02:35pm
|
||||
//
|
||||
// Returns the line count stored in editor
|
||||
//
|
||||
|
||||
FUNCTION EditorLCount( oEdit )
|
||||
|
||||
RETURN ED_LCount( oEdit[ E_EDIT ] )
|
||||
RETURN ed_LCount( oEdit[ E_EDIT ] )
|
||||
|
||||
//
|
||||
//06-03-92 07:09pm
|
||||
// 06-03-92 07:09pm
|
||||
//
|
||||
// Returns the specified line of text from the editor
|
||||
//
|
||||
|
||||
FUNCTION EditorGetLine( oEdit, nLine )
|
||||
|
||||
RETURN ED_GetLine( oEdit[ E_EDIT ], nLine )
|
||||
RETURN ed_GetLine( oEdit[ E_EDIT ], nLine )
|
||||
|
||||
//
|
||||
//06-03-92 07:10pm
|
||||
// 06-03-92 07:10pm
|
||||
//
|
||||
// Returns the next line of text
|
||||
//
|
||||
@@ -241,10 +241,10 @@ FUNCTION EditorGetLine( oEdit, nLine )
|
||||
|
||||
FUNCTION EditorNextLine( oEdit )
|
||||
|
||||
RETURN ED_GetNext( oEdit[ E_EDIT ] )
|
||||
RETURN ed_GetNext( oEdit[ E_EDIT ] )
|
||||
|
||||
//
|
||||
//03-06-93 10:11pm
|
||||
// 03-06-93 10:11pm
|
||||
//
|
||||
// Edit the specified file
|
||||
//
|
||||
@@ -286,7 +286,7 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ;
|
||||
nSize, nEscape )
|
||||
|
||||
IF nHandle > 0
|
||||
ED_ReadText( oEdit[ E_EDIT ], nHandle, 0, nLen, ;
|
||||
ed_ReadText( oEdit[ E_EDIT ], nHandle, 0, nLen, ;
|
||||
iif( lConv == NIL, .F., lConv ) )
|
||||
IF lClose
|
||||
FClose( nHandle )
|
||||
@@ -303,7 +303,7 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ;
|
||||
RETURN lSaved
|
||||
|
||||
//
|
||||
//06-07-93 06:05pm
|
||||
// 06-07-93 06:05pm
|
||||
//
|
||||
// Reads a text from a file into the editor
|
||||
//
|
||||
@@ -317,11 +317,11 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ;
|
||||
|
||||
FUNCTION EditorRead( oEditor, nHandle, nOffset, nLen, lConv )
|
||||
|
||||
RETURN ED_ReadText( oEditor[ E_EDIT ], nHandle, nOffset, nLen, ;
|
||||
RETURN ed_ReadText( oEditor[ E_EDIT ], nHandle, nOffset, nLen, ;
|
||||
iif( lConv == NIL, .T., lConv ) )
|
||||
|
||||
//
|
||||
//03-06-93 08:31pm
|
||||
// 03-06-93 08:31pm
|
||||
//
|
||||
// Start the editor
|
||||
//
|
||||
@@ -337,20 +337,24 @@ FUNCTION EditorEdit( oEdit, lEdit, lFrame )
|
||||
LOCAL nTop, nLeft, nBottom, nRight
|
||||
LOCAL lSaveAllowed, lSaved := .F.
|
||||
|
||||
oBox := SAVEBOX( oEdit[ E_TOP ], oEdit[ E_LEFT ], ;
|
||||
oBox := SaveBox( oEdit[ E_TOP ], oEdit[ E_LEFT ], ;
|
||||
oEdit[ E_BOTTOM ], oEdit[ E_RIGHT ], ;
|
||||
oEdit[ E_COLOR ], oEdit[ E_FRAME ] )
|
||||
|
||||
oEdit[ E_INSERT ] := Set( _SET_INSERT )
|
||||
// SayInsert()
|
||||
#if 0
|
||||
SayInsert()
|
||||
#endif
|
||||
nCursor := SetCursor( iif( oEdit[ E_INSERT ], SC_NORMAL, SC_SPECIAL1 ) )
|
||||
IF HB_ISLOGICAL( lEdit )
|
||||
oEdit[ E_MODE ] := lEdit
|
||||
ENDIF
|
||||
lSaveAllowed := ( SetKey( K_F2 ) == NIL )
|
||||
// IF lSaveAllowed
|
||||
// DisplayHelp( 73 ) // F2-save
|
||||
// ENDIF
|
||||
#if 0
|
||||
IF lSaveAllowed
|
||||
DisplayHelp( 73 ) // F2-save
|
||||
ENDIF
|
||||
#endif
|
||||
|
||||
nTop := oEdit[ E_TOP ] + 1
|
||||
nLeft := oEdit[ E_LEFT ] + 1
|
||||
@@ -372,43 +376,45 @@ FUNCTION EditorEdit( oEdit, lEdit, lFrame )
|
||||
(Well... this editor was created when AT-286 computers worked in
|
||||
its full glory :)
|
||||
*/
|
||||
ED_Config( oEdit[ E_EDIT ], nTop, nLeft, nBottom, nRight, 0, 0 )
|
||||
ed_Config( oEdit[ E_EDIT ], nTop, nLeft, nBottom, nRight, 0, 0 )
|
||||
|
||||
DO WHILE .T.
|
||||
nRow := ED_Stabilize( oEdit[ E_EDIT ] ) //displays all visible lines
|
||||
nRow := ed_Stabilize( oEdit[ E_EDIT ] ) // displays all visible lines
|
||||
// It doesn't uses incremantal stabilization for performance reasons
|
||||
|
||||
IF nRow != ED_Row( oEdit[ E_EDIT ] )
|
||||
nRow := ED_Row( oEdit[ E_EDIT ] )
|
||||
IF nRow != ed_Row( oEdit[ E_EDIT ] )
|
||||
nRow := ed_Row( oEdit[ E_EDIT ] )
|
||||
hb_DispOutAt( oEdit[ E_TOP ], nState, StrZero( nRow, 4 ) )
|
||||
ENDIF
|
||||
IF nCol != ED_Col( oEdit[ E_EDIT ] )
|
||||
nCol := ED_Col( oEdit[ E_EDIT ] )
|
||||
IF nCol != ed_Col( oEdit[ E_EDIT ] )
|
||||
nCol := ed_Col( oEdit[ E_EDIT ] )
|
||||
hb_DispOutAt( oEdit[ E_TOP ], nState + 5, StrZero( nCol, 3 ) )
|
||||
ENDIF
|
||||
SetPos( nTop + ED_WinRow( oEdit[ E_EDIT ] ), nLeft + ED_WinCol( oEdit[ E_EDIT ] ) )
|
||||
SetPos( nTop + ed_WinRow( oEdit[ E_EDIT ] ), nLeft + ed_WinCol( oEdit[ E_EDIT ] ) )
|
||||
|
||||
// nKey := WaitForKey()
|
||||
#if 0
|
||||
nKey := WaitForKey()
|
||||
#endif
|
||||
nKey := Inkey( 0 )
|
||||
|
||||
DO CASE
|
||||
CASE !( hb_keyChar( nKey ) == "" )
|
||||
IF oEdit[ E_MODE ]
|
||||
ED_PutChar( oEdit[ E_EDIT ], Asc( hb_keyChar( nKey ) ), oEdit[ E_INSERT ] )
|
||||
ed_PutChar( oEdit[ E_EDIT ], Asc( hb_keyChar( nKey ) ), oEdit[ E_INSERT ] )
|
||||
ENDIF
|
||||
|
||||
CASE nKey == K_F2 .AND. lSaveAllowed
|
||||
lSaved := EditorSave( oEdit ) //save the copy of edited buffer
|
||||
lSaved := EditorSave( oEdit ) // save the copy of edited buffer
|
||||
|
||||
CASE EditorMove( oEdit[ E_EDIT ], nKey )
|
||||
|
||||
CASE nKey == K_DOWN
|
||||
IF ! ED_Down( oEdit[ E_EDIT ] )
|
||||
IF ! ed_Down( oEdit[ E_EDIT ] )
|
||||
hb_Scroll( nTop, nLeft, nBottom, nRight, 1 )
|
||||
ENDIF
|
||||
|
||||
CASE nKey == K_UP
|
||||
IF ! ED_Up( oEdit[ E_EDIT ] )
|
||||
IF ! ed_Up( oEdit[ E_EDIT ] )
|
||||
hb_Scroll( nTop, nLeft, nBottom, nRight, -1 )
|
||||
ENDIF
|
||||
|
||||
@@ -428,17 +434,17 @@ FUNCTION EditorEdit( oEdit, lEdit, lFrame )
|
||||
ENDDO
|
||||
|
||||
SetCursor( nCursor )
|
||||
RESTBOX( oBox )
|
||||
// HELPREST.
|
||||
RestBox( oBox )
|
||||
// HELPREST.
|
||||
|
||||
RETURN lSaved
|
||||
|
||||
//
|
||||
//*
|
||||
// *
|
||||
//
|
||||
|
||||
//
|
||||
//03-06-93 08:35pm
|
||||
// 03-06-93 08:35pm
|
||||
//
|
||||
|
||||
STATIC PROCEDURE EditorKeys( oEdit, nKey )
|
||||
@@ -447,38 +453,42 @@ STATIC PROCEDURE EditorKeys( oEdit, nKey )
|
||||
|
||||
DO CASE
|
||||
CASE nKey == K_CTRL_Y
|
||||
ED_DelLine( oEdit[ E_EDIT ] )
|
||||
ed_DelLine( oEdit[ E_EDIT ] )
|
||||
|
||||
CASE nKey == K_CTRL_T
|
||||
ED_DelWord( oEdit[ E_EDIT ] )
|
||||
ed_DelWord( oEdit[ E_EDIT ] )
|
||||
|
||||
CASE nKey == K_DEL
|
||||
ED_DelChar( oEdit[ E_EDIT ] )
|
||||
ed_DelChar( oEdit[ E_EDIT ] )
|
||||
|
||||
CASE nKey == K_BS
|
||||
ED_BSpace( oEdit[ E_EDIT ], oEdit[ E_INSERT ] )
|
||||
ed_BSpace( oEdit[ E_EDIT ], oEdit[ E_INSERT ] )
|
||||
|
||||
CASE nKey == K_ENTER
|
||||
ED_Return( oEdit[ E_EDIT ], oEdit[ E_INSERT ] )
|
||||
ed_Return( oEdit[ E_EDIT ], oEdit[ E_INSERT ] )
|
||||
|
||||
CASE nKey == K_TAB
|
||||
// ED_Tab( oEdit[ E_EDIT ], oEdit[ E_INSERT ] )
|
||||
#if 0
|
||||
ed_Tab( oEdit[ E_EDIT ], oEdit[ E_INSERT ] )
|
||||
#endif
|
||||
FOR i := 1 TO 4
|
||||
ED_PutChar( oEdit[ E_EDIT ], Asc( " " ), oEdit[ E_INSERT ] )
|
||||
ed_PutChar( oEdit[ E_EDIT ], Asc( " " ), oEdit[ E_INSERT ] )
|
||||
NEXT
|
||||
|
||||
CASE nKey == K_INS
|
||||
oEdit[ E_INSERT ] := ! oEdit[ E_INSERT ]
|
||||
Set( _SET_INSERT, oEdit[ E_INSERT ] )
|
||||
SetCursor( iif( oEdit[ E_INSERT ], SC_NORMAL, SC_SPECIAL1 ) )
|
||||
// SayInsert()
|
||||
#if 0
|
||||
SayInsert()
|
||||
#endif
|
||||
|
||||
ENDCASE
|
||||
|
||||
RETURN
|
||||
|
||||
//
|
||||
//04-06-93 02:06am
|
||||
// 04-06-93 02:06am
|
||||
//
|
||||
|
||||
STATIC FUNCTION EditorMove( pEdit, nKey )
|
||||
@@ -486,25 +496,25 @@ STATIC FUNCTION EditorMove( pEdit, nKey )
|
||||
LOCAL lMoved := .T.
|
||||
|
||||
DO CASE
|
||||
CASE nKey == K_PGDN ; ED_PgDown( pEdit )
|
||||
CASE nKey == K_PGUP ; ED_PgUp( pEdit )
|
||||
CASE nKey == K_CTRL_PGUP ; ED_Top( pEdit )
|
||||
CASE nKey == K_CTRL_PGDN ; ED_Bottom( pEdit )
|
||||
CASE nKey == K_RIGHT ; ED_Right( pEdit )
|
||||
CASE nKey == K_LEFT ; ED_Left( pEdit )
|
||||
CASE nKey == K_HOME ; ED_Home( pEdit )
|
||||
CASE nKey == K_CTRL_HOME ; ED_Home( pEdit )
|
||||
CASE nKey == K_END ; ED_End( pEdit )
|
||||
CASE nKey == K_CTRL_END ; ED_End( pEdit )
|
||||
CASE nKey == K_CTRL_RIGHT // ; ED_NWord( pEdit ) //there are some problems with it
|
||||
CASE nKey == K_CTRL_LEFT ; ED_PWord( pEdit )
|
||||
CASE nKey == K_PGDN ; ed_PgDown( pEdit )
|
||||
CASE nKey == K_PGUP ; ed_PgUp( pEdit )
|
||||
CASE nKey == K_CTRL_PGUP ; ed_Top( pEdit )
|
||||
CASE nKey == K_CTRL_PGDN ; ed_Bottom( pEdit )
|
||||
CASE nKey == K_RIGHT ; ed_Right( pEdit )
|
||||
CASE nKey == K_LEFT ; ed_Left( pEdit )
|
||||
CASE nKey == K_HOME ; ed_Home( pEdit )
|
||||
CASE nKey == K_CTRL_HOME ; ed_Home( pEdit )
|
||||
CASE nKey == K_END ; ed_End( pEdit )
|
||||
CASE nKey == K_CTRL_END ; ed_End( pEdit )
|
||||
CASE nKey == K_CTRL_RIGHT // ; ed_NWord( pEdit ) //there are some problems with it
|
||||
CASE nKey == K_CTRL_LEFT ; ed_PWord( pEdit )
|
||||
OTHERWISE ; lMoved := .F.
|
||||
ENDCASE
|
||||
|
||||
RETURN lMoved
|
||||
|
||||
//
|
||||
//03-06-93 10:23pm
|
||||
// 03-06-93 10:23pm
|
||||
//
|
||||
|
||||
STATIC FUNCTION EditorSave( oEdit )
|
||||
@@ -530,7 +540,7 @@ STATIC FUNCTION EditorSave( oEdit )
|
||||
RETURN nHandle > 0
|
||||
|
||||
//
|
||||
//09/29/91 08:40pm
|
||||
// 09/29/91 08:40pm
|
||||
//
|
||||
|
||||
FUNCTION SaveBox( top, left, bott, right, kolor, patt )
|
||||
@@ -551,7 +561,7 @@ FUNCTION SaveBox( top, left, bott, right, kolor, patt )
|
||||
RETURN { top, left, nBottom, nRight, cBox, cClr }
|
||||
|
||||
//
|
||||
//09/29/91 08:42pm
|
||||
// 09/29/91 08:42pm
|
||||
//
|
||||
|
||||
PROCEDURE RestBox( oBox )
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
/* UTF-8 */
|
||||
|
||||
FUNCTION NumToTxtHU( nValue )
|
||||
|
||||
LOCAL aTort := { "tized", "század", "ezred", "tízezred", "százezred", "milliomod", "milliárdod" }
|
||||
LOCAL cRetVal
|
||||
LOCAL tmp, tmp1, tmp2
|
||||
@@ -111,10 +112,10 @@ STATIC FUNCTION NumToTxtRaw( nValue )
|
||||
aDigit[ tmp + 2 ] != 0
|
||||
|
||||
cValue += ;
|
||||
iif( Empty( cValue ), "", "-") +;
|
||||
iif( aDigit[ tmp ] != 0, aEgyes[ aDigit[ tmp ] + 1 ] + "száz", "" ) +;
|
||||
iif( aDigit[ tmp + 2 ] == 0, aTizes1[ aDigit[ tmp + 1 ] + 1 ], aTizes2[ aDigit[ tmp + 1 ] + 1 ] ) +;
|
||||
aEgyes[ aDigit[ tmp + 2 ] + 1 ] +;
|
||||
iif( Empty( cValue ), "", "-" ) + ;
|
||||
iif( aDigit[ tmp ] != 0, aEgyes[ aDigit[ tmp ] + 1 ] + "száz", "" ) + ;
|
||||
iif( aDigit[ tmp + 2 ] == 0, aTizes1[ aDigit[ tmp + 1 ] + 1 ], aTizes2[ aDigit[ tmp + 1 ] + 1 ] ) + ;
|
||||
aEgyes[ aDigit[ tmp + 2 ] + 1 ] + ;
|
||||
aEgesz[ ( Int( ( nLen - tmp ) / 3 ) ) + 1 ]
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user