2012-11-07 12:52 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbct/tests/*.prg
! applied casing to commented function names
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-11-07 12:52 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbct/tests/*.prg
|
||||
! applied casing to commented function names
|
||||
|
||||
2012-11-07 12:29 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbformat/hbfuncs.prg
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function ADDASCII()
|
||||
* Test CT3 function AddAscii()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,7 +58,7 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of ADDASCII()"
|
||||
? "Begin test of AddAscii()"
|
||||
?
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
@@ -67,38 +67,38 @@ PROCEDURE Main()
|
||||
? ' This should be "BAAA": ' + AddAscii( "AAAA", -255, 1 )
|
||||
? ' This should be "AAAB": ' + AddAscii( "AAAA", -255 )
|
||||
|
||||
// csetref() tests
|
||||
// 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 )
|
||||
? " 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()"
|
||||
? "End test of AddAscii()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 functions AFTERATNUM()
|
||||
* Test CT3 functions AfterAtNum()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,48 +62,48 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of AFTERATNUM()"
|
||||
? "Begin test of AfterAtNum()"
|
||||
?
|
||||
? " Value of cStr is:" + Chr( 34 ) + cStr + Chr( 34 )
|
||||
?
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' afteratnum("..",cStr) should be "test!",'
|
||||
? ' AfterAtNum("..",cStr) should be "test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr ) + '"'
|
||||
? ' afteratnum("..",cStr,2) should be ".is...a...test!",'
|
||||
? ' AfterAtNum("..",cStr,2) should be ".is...a...test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' afteratnum("..",cStr,2,2) should be ".a...test!",'
|
||||
? ' AfterAtNum("..",cStr,2,2) should be ".a...test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
?
|
||||
|
||||
// Tests with CSetAtMuPa(.T.)
|
||||
// Tests with CSetAtMupa(.T.)
|
||||
? " Multi-Pass tests"
|
||||
? " Setting csetatmupa() to .T."
|
||||
? " Setting CSetAtMupa() to .T."
|
||||
CSetAtMupa( .T. )
|
||||
? ' afteratnum("..",cStr) should be "test!",'
|
||||
? ' AfterAtNum("..",cStr) should be "test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr ) + '"'
|
||||
? ' afteratnum("..",cStr,2) should be "This...is...a...test!",'
|
||||
? ' AfterAtNum("..",cStr,2) should be "This...is...a...test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' afteratnum("..",cStr,2,2) should be "is...a...test!",'
|
||||
? ' AfterAtNum("..",cStr,2,2) should be "is...a...test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? " Setting csetatmupa() to .F."
|
||||
? " Setting CSetAtMupa() to .F."
|
||||
CSetAtMupa( .F. )
|
||||
?
|
||||
|
||||
// Tests mit SetAtlike(1)
|
||||
// Tests mit SetAtLike(1)
|
||||
? " SetAtLike tests"
|
||||
? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
? ' Setting SetAtLike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, "." )
|
||||
? ' afteratnum("..",cStr) should be "",'
|
||||
? ' AfterAtNum("..",cStr) should be "",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr ) + '"'
|
||||
? ' afteratnum("..",cStr,2,2) should be "s...is...a...test!",'
|
||||
? ' AfterAtNum("..",cStr,2,2) should be "s...is...a...test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' afteratnum("..",cStr,2,10) should be ".a...test!",'
|
||||
? ' AfterAtNum("..",cStr,2,10) should be ".a...test!",'
|
||||
? ' and is "' + AfterAtNum( "..", cStr, 2, 10 ) + '"'
|
||||
?
|
||||
|
||||
? "End test of AFTERATNUM()"
|
||||
? "End test of AfterAtNum()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function ASCIISUM()
|
||||
* Test CT3 function AsciiSum()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,15 +56,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of ASCIISUM()"
|
||||
? "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()"
|
||||
? "End test of AsciiSum()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function ASCPOS()
|
||||
* Test CT3 function AscPos()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,15 +56,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of ASCPOS()"
|
||||
? "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()"
|
||||
? "End test of AscPos()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function ATADJUST()
|
||||
* Test CT3 function AtAdjust()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -69,7 +69,7 @@ PROCEDURE Main()
|
||||
ctinit()
|
||||
|
||||
// Some simple tests
|
||||
? "Begin test of ATADJUST()"
|
||||
? "Begin test of AtAdjust()"
|
||||
?
|
||||
|
||||
? " Original strings:"
|
||||
@@ -78,27 +78,27 @@ PROCEDURE Main()
|
||||
NEXT
|
||||
?
|
||||
|
||||
? ' ATADJUST(":", aStr[ni], 21,,, ".") yields'
|
||||
? ' AtAdjust(":", aStr[ni], 21,,, ".") yields'
|
||||
FOR ni := 1 TO Len( aStr )
|
||||
? Space( 4 ) + AtAdjust( ":", aStr[ ni ], 21, 1,, "." )
|
||||
NEXT
|
||||
?
|
||||
|
||||
? ' ATADJUST(":", aStr[ni], 10, 1,, ".") yields'
|
||||
? ' AtAdjust(":", aStr[ni], 10, 1,, ".") yields'
|
||||
FOR ni := 1 TO Len( aStr )
|
||||
? Space( 4 ) + AtAdjust( ":", aStr[ ni ], 10, 1,, "." )
|
||||
NEXT
|
||||
?
|
||||
|
||||
? ' SETATLIKE(CT_SETATLIKE_WILDCARD, ":")'
|
||||
? ' ATADJUST(":", aStr[ni], 10, 1,, ".") yields now'
|
||||
? ' SetAtLike(CT_SETATLIKE_WILDCARD, ":")'
|
||||
? ' AtAdjust(":", aStr[ni], 10, 1,, ".") yields now'
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, ":" )
|
||||
FOR ni := 1 TO Len( aStr )
|
||||
? Space( 4 ) + AtAdjust( ":", aStr[ ni ], 10, 1,, "." )
|
||||
NEXT
|
||||
?
|
||||
|
||||
? "End test of ATADJUST()"
|
||||
? "End test of AtAdjust()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 functions ATNUM()
|
||||
* Test CT3 functions AtNum()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,48 +62,48 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of ATNUM()"
|
||||
? "Begin test of AtNum()"
|
||||
?
|
||||
? " Value of cStr is:" + Chr( 34 ) + cStr + Chr( 34 )
|
||||
?
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' atnum("..",cStr) should be 18,'
|
||||
? ' AtNum("..",cStr) should be 18,'
|
||||
? ' and is ', AtNum( "..", cStr )
|
||||
? ' atnum("..",cStr,2) should be 8,'
|
||||
? ' AtNum("..",cStr,2) should be 8,'
|
||||
? ' and is ', AtNum( "..", cStr, 2 )
|
||||
? ' atnum("..",cStr,2,2) should be 13,'
|
||||
? ' AtNum("..",cStr,2,2) should be 13,'
|
||||
? ' and is ', AtNum( "..", cStr, 2, 2 )
|
||||
?
|
||||
|
||||
// Tests with CSetAtMuPa(.T.)
|
||||
// Tests with CSetAtMupa(.T.)
|
||||
? " Multi-Pass tests"
|
||||
? " Setting csetatmupa() to .T."
|
||||
? " Setting CSetAtMupa() to .T."
|
||||
CSetAtMupa( .T. )
|
||||
? ' atnum("..",cStr) should be 18,'
|
||||
? ' AtNum("..",cStr) should be 18,'
|
||||
? ' and is ', AtNum( "..", cStr )
|
||||
? ' atnum("..",cStr,2) should be 2,'
|
||||
? ' AtNum("..",cStr,2) should be 2,'
|
||||
? ' and is ', AtNum( "..", cStr, 2 )
|
||||
? ' atnum("..",cStr,2,2) should be 9,'
|
||||
? ' AtNum("..",cStr,2,2) should be 9,'
|
||||
? ' and is ', AtNum( "..", cStr, 2, 2 )
|
||||
? " Setting csetatmupa() to .F."
|
||||
? " Setting CSetAtMupa() to .F."
|
||||
CSetAtMupa( .F. )
|
||||
?
|
||||
|
||||
// Tests mit SetAtlike(1)
|
||||
// Tests mit SetAtLike(1)
|
||||
? " SetAtLike tests"
|
||||
? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
? ' Setting SetAtLike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, "." )
|
||||
? ' atnum("..",cStr) should be 23,'
|
||||
? ' AtNum("..",cStr) should be 23,'
|
||||
? ' and is ', AtNum( "..", cStr )
|
||||
? ' atnum("..",cStr,2,2) should be 5,'
|
||||
? ' AtNum("..",cStr,2,2) should be 5,'
|
||||
? ' and is ', AtNum( "..", cStr, 2, 2 )
|
||||
? ' atnum("..",cStr,2,10) should be 13,'
|
||||
? ' AtNum("..",cStr,2,10) should be 13,'
|
||||
? ' and is ', AtNum( "..", cStr, 2, 10 )
|
||||
?
|
||||
|
||||
? "End test of ATNUM()"
|
||||
? "End test of AtNum()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function ATREPL()
|
||||
* Test CT3 function AtRepl()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,20 +56,20 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of ATREPL()"
|
||||
? "Begin test of AtRepl()"
|
||||
?
|
||||
|
||||
// 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", 2, .T., 1) == "ABCDABCDxx" ? '
|
||||
? ' 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 ) + '"'
|
||||
|
||||
? "End test of ATREPL()"
|
||||
? "End test of AtRepl()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function ATTOKEN()
|
||||
* Test CT3 function AtToken()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -63,15 +63,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of ATTOKEN()"
|
||||
? "Begin test of AtToken()"
|
||||
?
|
||||
|
||||
// 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:'
|
||||
@@ -84,7 +84,7 @@ PROCEDURE Main()
|
||||
NEXT
|
||||
|
||||
?
|
||||
? "End test of ATTOKEN()"
|
||||
? "End test of AtToken()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 functions BEFORATNUM()
|
||||
* Test CT3 functions BeforAtNum()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,48 +62,48 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of BEFORATNUM()"
|
||||
? "Begin test of BeforAtNum()"
|
||||
?
|
||||
? " Value of cStr is:" + Chr( 34 ) + cStr + Chr( 34 )
|
||||
?
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' beforatnum("..",cStr) should be "...This...is...a.",'
|
||||
? ' BeforAtNum("..",cStr) should be "...This...is...a.",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr ) + '"'
|
||||
? ' beforatnum("..",cStr,2) should be "...This",'
|
||||
? ' BeforAtNum("..",cStr,2) should be "...This",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' beforatnum("..",cStr,2,2) should be "...This...is",'
|
||||
? ' BeforAtNum("..",cStr,2,2) should be "...This...is",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
?
|
||||
|
||||
// Tests with CSetAtMuPa(.T.)
|
||||
// Tests with CSetAtMupa(.T.)
|
||||
? " Multi-Pass tests"
|
||||
? " Setting csetatmupa() to .T."
|
||||
? " Setting CSetAtMupa() to .T."
|
||||
CSetAtMupa( .T. )
|
||||
? ' beforatnum("..",cStr) should be "...This...is...a.",'
|
||||
? ' BeforAtNum("..",cStr) should be "...This...is...a.",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr ) + '"'
|
||||
? ' beforatnum("..",cStr,2) should be ".",'
|
||||
? ' BeforAtNum("..",cStr,2) should be ".",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2 ) + '"'
|
||||
? ' beforatnum("..",cStr,2,2) should be "...This.",'
|
||||
? ' BeforAtNum("..",cStr,2,2) should be "...This.",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? " Setting csetatmupa() to .F."
|
||||
? " Setting CSetAtMupa() to .F."
|
||||
CSetAtMupa( .F. )
|
||||
?
|
||||
|
||||
// Tests mit SetAtlike(1)
|
||||
// Tests mit SetAtLike(1)
|
||||
? " SetAtLike tests"
|
||||
? ' Setting setatlike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
? ' Setting SetAtLike(CT_SETATLIKE_WILDCARD, ".")'
|
||||
SetAtLike( CT_SETATLIKE_WILDCARD, "." )
|
||||
? ' beforatnum("..",cStr) should be "...This...is...a...tes",'
|
||||
? ' BeforAtNum("..",cStr) should be "...This...is...a...tes",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr ) + '"'
|
||||
? ' beforatnum("..",cStr,2,2) should be "...T",'
|
||||
? ' BeforAtNum("..",cStr,2,2) should be "...T",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 2 ) + '"'
|
||||
? ' beforatnum("..",cStr,2,10) should be "...This...is",'
|
||||
? ' BeforAtNum("..",cStr,2,10) should be "...This...is",'
|
||||
? ' and is "' + BeforAtNum( "..", cStr, 2, 10 ) + '"'
|
||||
?
|
||||
|
||||
? "End test of BEFORATNUM()"
|
||||
? "End test of BeforAtNum()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARADD()
|
||||
* Test CT3 function CharAdd()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,17 +56,17 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARADD()"
|
||||
? "Begin test of CharAdd()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharAdd()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARAND()
|
||||
* Test CT3 function ChaRand()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARAND()"
|
||||
? "Begin test of ChaRand()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of ChaRand()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHAREVEN()
|
||||
* Test CT3 function CharEven()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHAREVEN()"
|
||||
? "Begin test of CharEven()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharEven()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARHIST()
|
||||
* Test CT3 function CharHist()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,17 +58,17 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARHIST()"
|
||||
? "Begin test of CharHist()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charhist("Hello World !")' + "'109' == 3 ? --> ", CharHist( "Hello World !" )' 109 '
|
||||
? ' aeval(charhist("Hello World !"), {| x | nTotal += x } ) '
|
||||
? ' CharHist("Hello World !")' + "'109' == 3 ? --> ", CharHist( "Hello World !" )' 109 '
|
||||
? ' 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()"
|
||||
? "End test of CharHist()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARLIST()
|
||||
* Test CT3 function CharList()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,15 +56,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARLIST()"
|
||||
? "Begin test of CharList()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharList()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARMIRR()
|
||||
* Test CT3 function CharMirr()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARMIRR()"
|
||||
? "Begin test of CharMirr()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharMirr()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARMIX()
|
||||
* Test CT3 function CharMix()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,19 +56,19 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARMIX()"
|
||||
? "Begin test of CharMix()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharMix()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARNOLIST()
|
||||
* Test CT3 function CharNoList()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARNOLIST()"
|
||||
? "Begin test of CharNoList()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharNoList()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -62,30 +62,30 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARNOT()"
|
||||
? "Begin test of CharNot()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
|
||||
? ' charnot(chr(85)+chr(128)+chr(170)+chr(1)) == '
|
||||
? ' chr(170)+chr(127)+chr(85)+chr(254) ? -->'
|
||||
? ' CharNot(Chr(85)+Chr(128)+Chr(170)+Chr(1)) == '
|
||||
? ' Chr(170)+Chr(127)+Chr(85)+Chr(254) ? -->'
|
||||
|
||||
? ' '
|
||||
cStr := CharNot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
?? "Chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
?? "+"
|
||||
ENDIF
|
||||
NEXT
|
||||
?
|
||||
|
||||
? ' charnot(charnot("This is a test!")) == "This is a test!" ?'
|
||||
? ' CharNot(CharNot("This is a test!")) == "This is a test!" ?'
|
||||
? ' --> "' + CharNot( CharNot( "This is a test!" ) ) + '"'
|
||||
?
|
||||
|
||||
? "End test of CHARNOT()"
|
||||
? "End test of CharNot()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARODD()
|
||||
* Test CT3 function CharOdd()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,15 +56,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARODD()"
|
||||
? "Begin test of CharOdd()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharOdd()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARONE()
|
||||
* Test CT3 function CharOne()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,19 +56,19 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARONE()"
|
||||
? "Begin test of CharOne()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharOne()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARONLY()
|
||||
* Test CT3 function CharOnly()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARONLY()"
|
||||
? "Begin test of CharOnly()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharOnly()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHAROR()
|
||||
* Test CT3 function CharOr()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHAROR()"
|
||||
? "Begin test of CharOr()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharOr()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARREM()
|
||||
* Test CT3 function CharRem()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARREM()"
|
||||
? "Begin test of CharRem()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharRem()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARREPL()
|
||||
* Test CT3 function CharRepl()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,19 +56,19 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARREPL()"
|
||||
? "Begin test of CharRepl()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharRepl()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARRLL()
|
||||
* Test CT3 function CharRll()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,26 +62,26 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARRLL()"
|
||||
? "Begin test of CharRll()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charrll(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+'
|
||||
? ' chr(64)+chr(128), 3) == '
|
||||
? ' chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4) ? -->'
|
||||
? ' CharRll(Chr(1)+Chr(2)+Chr(4)+Chr(8)+Chr(16)+Chr(32)+'
|
||||
? ' Chr(64)+Chr(128), 3) == '
|
||||
? ' 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 )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
?? "Chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
?? "+"
|
||||
ENDIF
|
||||
NEXT
|
||||
?
|
||||
|
||||
? "End test of CHARRLL()"
|
||||
? "End test of CharRll()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARRLR()
|
||||
* Test CT3 function CharRlr()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,26 +62,26 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARRLR()"
|
||||
? "Begin test of CharRlr()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charrlr(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+'
|
||||
? ' chr(64)+chr(128), 3) == '
|
||||
? ' chr(32)+chr(64)+chr(128)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->'
|
||||
? ' CharRlr(Chr(1)+Chr(2)+Chr(4)+Chr(8)+Chr(16)+Chr(32)+'
|
||||
? ' Chr(64)+Chr(128), 3) == '
|
||||
? ' 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 )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
?? "Chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
?? "+"
|
||||
ENDIF
|
||||
NEXT
|
||||
?
|
||||
|
||||
? "End test of CHARRLR()"
|
||||
? "End test of CharRlr()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARSHL()
|
||||
* Test CT3 function CharShl()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,26 +62,26 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARSHL()"
|
||||
? "Begin test of CharShl()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charshl(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+'
|
||||
? ' chr(64)+chr(128), 3) == '
|
||||
? ' chr(8)+chr(16)+chr(32)+chr(64)+chr(128)+chr(0)+chr(0)+chr(0) ? -->'
|
||||
? ' CharShl(Chr(1)+Chr(2)+Chr(4)+Chr(8)+Chr(16)+Chr(32)+'
|
||||
? ' Chr(64)+Chr(128), 3) == '
|
||||
? ' Chr(8)+Chr(16)+Chr(32)+Chr(64)+Chr(128)+Chr(0)+Chr(0)+Chr(0) ? -->'
|
||||
|
||||
? ' '
|
||||
cStr := charshl( Chr( 1 ) + Chr( 2 ) + Chr( 4 ) + Chr( 8 ) + Chr( 16 ) + Chr( 32 ) + Chr( 64 ) + Chr( 128 ), 3 )
|
||||
cStr := CharShl( 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 ) ) ) + ")"
|
||||
?? "Chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
?? "+"
|
||||
ENDIF
|
||||
NEXT
|
||||
?
|
||||
|
||||
? "End test of CHARSHL()"
|
||||
? "End test of CharShl()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARSHR()
|
||||
* Test CT3 function CharShr()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -62,26 +62,26 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARSHR()"
|
||||
? "Begin test of CharShr()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charshr(chr(1)+chr(2)+chr(4)+chr(8)+chr(16)+chr(32)+'
|
||||
? ' chr(64)+chr(128), 3) == '
|
||||
? ' chr(0)+chr(0)+chr(0)+chr(1)+chr(2)+chr(4)+chr(8)+chr(16) ? -->'
|
||||
? ' CharShr(Chr(1)+Chr(2)+Chr(4)+Chr(8)+Chr(16)+Chr(32)+'
|
||||
? ' Chr(64)+Chr(128), 3) == '
|
||||
? ' 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 )
|
||||
FOR ni := 1 TO Len( cStr )
|
||||
?? "chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
?? "Chr(" + hb_ntos( Asc( SubStr( cStr, ni, 1 ) ) ) + ")"
|
||||
IF ni < Len( cStr )
|
||||
?? "+"
|
||||
ENDIF
|
||||
NEXT
|
||||
?
|
||||
|
||||
? "End test of CHARSHR()"
|
||||
? "End test of CharShr()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARSLIST()
|
||||
* Test CT3 function CharSList()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,15 +56,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARSLIST()"
|
||||
? "Begin test of CharSList()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharSList()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARSORT()
|
||||
* Test CT3 function CharSort()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,23 +56,23 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARSORT()"
|
||||
? "Begin test of CharSort()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharSort()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARSUB()
|
||||
* Test CT3 function CharSub()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,17 +56,17 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARSUB()"
|
||||
? "Begin test of CharSub()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharSub()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARSWAP()
|
||||
* Test CT3 function CharSwap()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARSWAP()"
|
||||
? "Begin test of CharSwap()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of CharSwap()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CHARXOR()
|
||||
* Test CT3 function CharXor()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CHARXOR()"
|
||||
? "Begin test of CharXor()"
|
||||
?
|
||||
|
||||
// simple tests
|
||||
? "Simple tests:"
|
||||
? ' charxor(charxor("This is top secret !", "My Password"),'
|
||||
? ' CharXor(CharXor("This is top secret !", "My Password"),'
|
||||
? ' "My Password") == "This is top secret !" ? ->'
|
||||
? ' ' + CharXor( CharXor( "This is top secret !", "My Password" ), "My Password" )
|
||||
|
||||
? "End test of CHARXOR()"
|
||||
? "End test of CharXor()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CSETARGERR()
|
||||
* Test CT3 function CSetArgErr()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -66,7 +66,7 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CSETARGERR()"
|
||||
? "Begin test of CSetArgErr()"
|
||||
?
|
||||
|
||||
?
|
||||
@@ -77,11 +77,11 @@ PROCEDURE Main()
|
||||
// standard behaviour on argument error
|
||||
?
|
||||
? "Standard behaviour"
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
? " Call to AddAscii(5789676,1,2,.T.):"
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -91,11 +91,11 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_WHOCARES behaviour"
|
||||
CSetArgErr( CT_ARGERR_WHOCARES )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
? " Call to AddAscii(5789676,1,2,.T.):"
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -105,11 +105,11 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_WARNING behaviour"
|
||||
CSetArgErr( CT_ARGERR_WARNING )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
? " Call to AddAscii(5789676,1,2,.T.):"
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -119,11 +119,11 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_ERROR behaviour"
|
||||
CSetArgErr( CT_ARGERR_ERROR )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
? " Call to AddAscii(5789676,1,2,.T.):"
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -133,11 +133,11 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_CATASTROPHIC behaviour"
|
||||
CSetArgErr( CT_ARGERR_CATASTROPHIC )
|
||||
? " Call to addascii(5789676,1,2,.T.):"
|
||||
? " Call to AddAscii(5789676,1,2,.T.):"
|
||||
cRet := AddAscii( 5789676, 1, 2, .T. )
|
||||
? " return value was", cRet
|
||||
?
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -150,7 +150,7 @@ PROCEDURE Main()
|
||||
// standard behaviour on argument error
|
||||
?
|
||||
? "Standard behaviour"
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -160,7 +160,7 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_WHOCARES behaviour"
|
||||
CSetArgErr( CT_ARGERR_WHOCARES )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -170,7 +170,7 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_WARNING behaviour"
|
||||
CSetArgErr( CT_ARGERR_WARNING )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -180,7 +180,7 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_ERROR behaviour"
|
||||
CSetArgErr( CT_ARGERR_ERROR )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
@@ -190,13 +190,13 @@ PROCEDURE Main()
|
||||
?
|
||||
? "CT_ARGERR_CATASTROPHIC behaviour"
|
||||
CSetArgErr( CT_ARGERR_CATASTROPHIC )
|
||||
? " Call to charadd('AA',.F.):"
|
||||
? " Call to CharAdd('AA',.F.):"
|
||||
cRet := CharAdd( "AA", .F. )
|
||||
? " return value was", cRet, "<Press any key>"
|
||||
?
|
||||
Inkey( 0 )
|
||||
|
||||
? "End test of CSETARGERR()"
|
||||
? "End test of CSetArgErr()"
|
||||
|
||||
ctexit()
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CSETATMUPA()
|
||||
* Test CT3 function CSetAtMupa()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,12 +56,12 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CSETATMUPA()"
|
||||
? "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. )
|
||||
? "End test of CSETATMUPA()"
|
||||
? "End test of CSetAtMupa()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function CSETREF()
|
||||
* Test CT3 function CSetRef()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,12 +56,12 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of CSETREF()"
|
||||
? "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. )
|
||||
? "End test of CSETREF()"
|
||||
? "End test of CSetRef()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -63,27 +63,27 @@ PROCEDURE Main( cLang )
|
||||
LOCAL nChoice := 1
|
||||
LOCAL c := .T.
|
||||
LOCAL farr := { ;
|
||||
"addmonth( dDate ) Add a month to dDate ", ;
|
||||
"bom() Beginning of month ", ;
|
||||
"boq() Returns first date of qtr ", ;
|
||||
"boy() Beginning of year ", ;
|
||||
"ctodow() Day name to day number ", ;
|
||||
"ctomonth() Month name to number ", ;
|
||||
"daysInMonth() number of days in xMonth ", ;
|
||||
"daystomonth(dDate) Returns num days to month ", ;
|
||||
"dmy( dDate, lmode) date as DD month YY ", ;
|
||||
"doy( dDate ) Returns day of the year ", ;
|
||||
"eom( dDate ) Returns last day of month ", ;
|
||||
"eoq( dDate ) Returns last date of qtr ", ;
|
||||
"eoy( dDate ) Returns last day of year ", ;
|
||||
"isleap( dDate ) Returns .T. if leap year ", ;
|
||||
"lastdayom( dDate ) Returns num days in month ", ;
|
||||
"mdy( dDate ) Returns stg Month DD, YY ", ;
|
||||
"ntocdow( nDay ) Returns name of day ", ;
|
||||
"ntocmonth( nMth ) Returns name of month ", ;
|
||||
"quarter(date) Returns qtr number of date", ;
|
||||
"AddMonth( dDate ) Add a month to dDate ", ;
|
||||
"BoM() Beginning of month ", ;
|
||||
"BoQ() Returns first date of qtr ", ;
|
||||
"BoY() Beginning of year ", ;
|
||||
"CToDoW() Day name to day number ", ;
|
||||
"CToMonth() Month name to number ", ;
|
||||
"DaysInMonth() number of days in xMonth ", ;
|
||||
"DaysToMonth(dDate) Returns num days to month ", ;
|
||||
"DMY( dDate, lmode) date as DD month YY ", ;
|
||||
"DoY( dDate ) Returns day of the year ", ;
|
||||
"EoM( dDate ) Returns last day of month ", ;
|
||||
"EoQ( dDate ) Returns last date of qtr ", ;
|
||||
"EoY( dDate ) Returns last day of year ", ;
|
||||
"IsLeap( dDate ) Returns .T. if leap year ", ;
|
||||
"LastDayOM( dDate ) Returns num days in month ", ;
|
||||
"MDY( dDate ) Returns stg Month DD, YY ", ;
|
||||
"NToCDoW( nDay ) Returns name of day ", ;
|
||||
"NToCMonth( nMth ) Returns name of month ", ;
|
||||
"Quarter(date) Returns qtr number of date", ;
|
||||
"stod( ansi date) Returns Clipper date ", ;
|
||||
"week( dDate, lSWN ) Returns numbef of week ", }
|
||||
"Week( dDate, lSWN ) Returns numbef of week ", }
|
||||
|
||||
SET DATE ANSI
|
||||
SET CENTURY ON
|
||||
@@ -161,7 +161,7 @@ PROCEDURE Main( cLang )
|
||||
FUNCTION addmtest()
|
||||
|
||||
//
|
||||
// addmonth(dDate, nMonths)
|
||||
// AddMonth(dDate, nMonths)
|
||||
// =========================
|
||||
// This version will only accept an nMonths value of from 0 to 70
|
||||
|
||||
@@ -172,7 +172,7 @@ FUNCTION addmtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "addmonth(dDate) returns the date incremented by"
|
||||
@ 5, 10 SAY "AddMonth(dDate) returns the date incremented by"
|
||||
@ 6, 10 SAY "the number of days in months."
|
||||
@ 7, 10 SAY "Insert a date"
|
||||
@ 8, 10 SAY "How many months"
|
||||
@@ -210,7 +210,7 @@ FUNCTION addmtest()
|
||||
FUNCTION bomtest()
|
||||
|
||||
//
|
||||
// bom( dDate )
|
||||
// BoM( dDate )
|
||||
// =============
|
||||
|
||||
LOCAL getlist := {}
|
||||
@@ -219,8 +219,8 @@ FUNCTION bomtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "bom(dDate) returns the date of the first day of dDate"
|
||||
@ 6, 10 SAY "If dDate is 2002/10/15 (that's in yyyy/mm/dd), bom()"
|
||||
@ 5, 10 SAY "BoM(dDate) returns the date of the first day of dDate"
|
||||
@ 6, 10 SAY "If dDate is 2002/10/15 (that's in yyyy/mm/dd), BoM()"
|
||||
@ 7, 10 SAY "should return 2002/10/01. Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -254,7 +254,7 @@ FUNCTION bomtest()
|
||||
FUNCTION boqtest()
|
||||
|
||||
//
|
||||
// bom( dDate )
|
||||
// BoM( dDate )
|
||||
// =============
|
||||
|
||||
LOCAL getlist := {}
|
||||
@@ -263,9 +263,9 @@ FUNCTION boqtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "boq(dDate) returns the date of the first day of the"
|
||||
@ 5, 10 SAY "BoQ(dDate) returns the date of the first day of the"
|
||||
@ 6, 10 SAY "quarter in which dDate is situated. If dDate is"
|
||||
@ 7, 10 SAY "2002/10/15 (that's in yyyy/mm/dd), BOQ() should return"
|
||||
@ 7, 10 SAY "2002/10/15 (that's in yyyy/mm/dd), BoQ() should return"
|
||||
@ 8, 10 SAY "2002/09/01. Test it, Insert a date"
|
||||
|
||||
@ 9, 10 GET dDate
|
||||
@@ -300,7 +300,7 @@ FUNCTION boqtest()
|
||||
FUNCTION boytest()
|
||||
|
||||
//
|
||||
// boy( dDate )
|
||||
// BoY( dDate )
|
||||
// =============
|
||||
|
||||
LOCAL getlist := {}
|
||||
@@ -309,8 +309,8 @@ FUNCTION boytest()
|
||||
LOCAL nkey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "boy(dDate) returns the date of the first day of dDate"
|
||||
@ 6, 10 SAY "If dDate is 2002/10/15 (that's in yyyy/mm/dd), boy()"
|
||||
@ 5, 10 SAY "BoY(dDate) returns the date of the first day of dDate"
|
||||
@ 6, 10 SAY "If dDate is 2002/10/15 (that's in yyyy/mm/dd), BoY()"
|
||||
@ 7, 10 SAY "should return 2002/01/01. Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -346,7 +346,7 @@ FUNCTION boytest()
|
||||
FUNCTION ctodowtest()
|
||||
|
||||
//
|
||||
// ctodow( cDow )
|
||||
// CToDoW( cDow )
|
||||
// ==============
|
||||
// Convert name of day of the week to its ordinal number
|
||||
// if cDow is invalid, returns 0
|
||||
@@ -358,7 +358,7 @@ FUNCTION ctodowtest()
|
||||
LOCAL c := .T.
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "ctodow(dDate) receives the name of a day of the week and "
|
||||
@ 5, 10 SAY "CToDoW(dDate) receives the name of a day of the week and "
|
||||
@ 6, 10 SAY "returns a number representing its position in the week"
|
||||
@ 7, 10 SAY "Sunday returns 1. Test it, Insert a day"
|
||||
@ 9, 10 GET cDow
|
||||
@@ -395,10 +395,10 @@ FUNCTION ctodowtest()
|
||||
FUNCTION ctomonthtest()
|
||||
|
||||
//
|
||||
// ctomonth(cDom )
|
||||
// CToMonth(cDom )
|
||||
// ===============
|
||||
// Convert the name of a month to its ordinal number. If cMonth is
|
||||
// invalid, ctomonth() Returns 0. English month names only
|
||||
// invalid, CToMonth() Returns 0. English month names only
|
||||
|
||||
LOCAL getlist := {}
|
||||
LOCAL cDom := Space( 9 )
|
||||
@@ -406,7 +406,7 @@ FUNCTION ctomonthtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "ctomonth(dDate) receives the name of a month and returns"
|
||||
@ 5, 10 SAY "CToMonth(dDate) receives the name of a month and returns"
|
||||
@ 6, 10 SAY "a number representing its position in the month. April"
|
||||
@ 7, 10 SAY "returns 4. Test it, Insert a month"
|
||||
@ 9, 10 GET cDom PICTURE "!!!!!!!!!"
|
||||
@@ -444,7 +444,7 @@ FUNCTION ctomonthtest()
|
||||
FUNCTION dInMonthtest()
|
||||
|
||||
//
|
||||
// daysInMonth( xDate, lleap )
|
||||
// DaysInMonth( xDate, lleap )
|
||||
// ============================
|
||||
// Returns the number of days in nMonth, either whose name as a
|
||||
// string or month number is passed. English Month names only.
|
||||
@@ -457,7 +457,7 @@ FUNCTION dInMonthtest()
|
||||
LOCAL cLeap := Space( 1 )
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "daysInmonth() receives either the number of a month or"
|
||||
@ 5, 10 SAY "DaysInMonth() receives either the number of a month or"
|
||||
@ 6, 10 SAY "its name and returns the number of days in the month. "
|
||||
@ 7, 10 SAY "April returns 30. Test it. Insert a month number"
|
||||
@ 8, 10 SAY "Is it a leap year?"
|
||||
@@ -512,7 +512,7 @@ FUNCTION dInMonthtest()
|
||||
FUNCTION d2month()
|
||||
|
||||
//
|
||||
// daystomonth()
|
||||
// DaysToMonth()
|
||||
// =============
|
||||
// Total number days from first of Jan to beginning of nMonth.
|
||||
// lLeap is .F. for a non-leap year but .T. if it is. If so and
|
||||
@@ -526,7 +526,7 @@ FUNCTION d2month()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "daystomonth() receives the number a month and returns"
|
||||
@ 5, 10 SAY "DaysToMonth() receives the number a month and returns"
|
||||
@ 6, 10 SAY "the number of days in the year up to that month. March"
|
||||
@ 7, 10 SAY "returns 59 or 60 in a leap year. Test it."
|
||||
@ 8, 10 SAY "Insert a month number"
|
||||
@@ -570,7 +570,7 @@ FUNCTION d2month()
|
||||
FUNCTION dmytest()
|
||||
|
||||
//
|
||||
// dmy( dDate, lmode)
|
||||
// DMY( dDate, lmode)
|
||||
// ===================
|
||||
// Returns the date as a string in DD Month YY format. If lmode
|
||||
// is .T., a "." is inserted after the DD
|
||||
@@ -584,7 +584,7 @@ FUNCTION dmytest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "dmy() receives a date and logical lmode. If lmode is"
|
||||
@ 5, 10 SAY "DMY() receives a date and logical lmode. If lmode is"
|
||||
@ 6, 10 SAY "is either missing or FALSE, dmy returns the date as"
|
||||
@ 7, 10 SAY "a string in DD Month YY format. If lmode is TRUE, a"
|
||||
@ 8, 10 SAY "full stop or perod '.' is inserted after DD. Test it"
|
||||
@@ -627,7 +627,7 @@ FUNCTION dmytest()
|
||||
FUNCTION doytest()
|
||||
|
||||
//
|
||||
// doy( dDate )
|
||||
// DoY( dDate )
|
||||
// =============
|
||||
// Determines the day of the year for a specific date
|
||||
// if dDate is invalid, returns 0
|
||||
@@ -638,7 +638,7 @@ FUNCTION doytest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "doy(dDate) returns the day of the year for the"
|
||||
@ 5, 10 SAY "DoY(dDate) returns the day of the year for the"
|
||||
@ 6, 10 SAY "date passed. Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -675,7 +675,7 @@ FUNCTION doytest()
|
||||
FUNCTION eomtest()
|
||||
|
||||
//
|
||||
// dBom := eom( dDate )
|
||||
// dBom := EoM( dDate )
|
||||
// =====================
|
||||
// Returns the last date in the month of the month appearing in
|
||||
// date.
|
||||
@@ -686,7 +686,7 @@ FUNCTION eomtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "eom(dDate) returns the last date in the month of the"
|
||||
@ 5, 10 SAY "EoM(dDate) returns the last date in the month of the"
|
||||
@ 6, 10 SAY "month appearing in dDate. Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -724,7 +724,7 @@ FUNCTION eomtest()
|
||||
FUNCTION eoqtest()
|
||||
|
||||
//
|
||||
// dret := eoq( dDate )
|
||||
// dret := EoQ( dDate )
|
||||
// =====================
|
||||
// Returns the last date in the quarter in which dDate falls.
|
||||
|
||||
@@ -734,7 +734,7 @@ FUNCTION eoqtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "EOQ(dDate) returns the last date in the quarter in"
|
||||
@ 5, 10 SAY "EoQ(dDate) returns the last date in the quarter in"
|
||||
@ 6, 10 SAY "which dDate falls. Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -772,7 +772,7 @@ FUNCTION eoqtest()
|
||||
FUNCTION eoytest()
|
||||
|
||||
//
|
||||
// dEoy := eoy( dDate )
|
||||
// dEoy := EoY( dDate )
|
||||
// =====================
|
||||
// Returns the last date in the year of the year appearing in
|
||||
// date.
|
||||
@@ -783,7 +783,7 @@ FUNCTION eoytest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "eoy(dDate) returns the last date in the year of the"
|
||||
@ 5, 10 SAY "EoY(dDate) returns the last date in the year of the"
|
||||
@ 6, 10 SAY "year appearing in dDate. Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -821,7 +821,7 @@ FUNCTION eoytest()
|
||||
FUNCTION isleaptest()
|
||||
|
||||
//
|
||||
// lRet := isleap( dDate )
|
||||
// lRet := IsLeap( dDate )
|
||||
// ========================
|
||||
// if dDate is a leap year, lRet is .T., otherwise .F..
|
||||
// Leap years are exactly divisible by 4 and 1,000 but not 100.
|
||||
@@ -833,7 +833,7 @@ FUNCTION isleaptest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "isleap(dDate) returns TRUE if dDate is a leap year"
|
||||
@ 5, 10 SAY "IsLeap(dDate) returns TRUE if dDate is a leap year"
|
||||
@ 6, 10 SAY "Test it, Insert a date"
|
||||
@ 9, 10 GET dDate
|
||||
|
||||
@@ -876,7 +876,7 @@ FUNCTION isleaptest()
|
||||
FUNCTION lastdayomtest()
|
||||
|
||||
//
|
||||
// ndays := lastdayom( xDate )
|
||||
// ndays := LastDayOM( xDate )
|
||||
// ===========================
|
||||
// Returns the the number of days in the month.
|
||||
// xDate can be a date or a month number. If empty uses the
|
||||
@@ -890,7 +890,7 @@ FUNCTION lastdayomtest()
|
||||
LOCAL cMth := " "
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "lastdayom(xDate) returns the number of days in the"
|
||||
@ 5, 10 SAY "LastDayOM(xDate) returns the number of days in the"
|
||||
@ 6, 10 SAY "month appearing in date. Or, if only a month number"
|
||||
@ 7, 10 SAY "is passed, in that month. Test it. "
|
||||
@ 9, 10 SAY "Insert a date(or)"
|
||||
@@ -936,7 +936,7 @@ FUNCTION lastdayomtest()
|
||||
FUNCTION mdytest()
|
||||
|
||||
//
|
||||
// cDate := mdy( dDate )
|
||||
// cDate := MDY( dDate )
|
||||
// ======================
|
||||
// Returns the date as a string in "Month DD, YY" or "Month DD, YYYY"
|
||||
// If dDate is NULL, the system date is used
|
||||
@@ -948,7 +948,7 @@ FUNCTION mdytest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "mdy() receives a date. mdy returns the date as"
|
||||
@ 5, 10 SAY "MDY() receives a date. mdy returns the date as"
|
||||
@ 6, 10 SAY "a string in month DD YY format. Test it"
|
||||
@ 8, 10 SAY "Insert a date"
|
||||
@ 8, 30 GET dDate PICTURE "@D / / "
|
||||
@@ -987,9 +987,9 @@ FUNCTION mdytest()
|
||||
FUNCTION ntocdowtest()
|
||||
|
||||
//
|
||||
// cDay := ntocdow( nDayNum )
|
||||
// cDay := NToCDoW( nDayNum )
|
||||
// ==================================
|
||||
// ntocdow() receives the number of a day and returns its
|
||||
// NToCDoW() receives the number of a day and returns its
|
||||
// name as a string. This version does not observe the Nations
|
||||
// module. English only.
|
||||
|
||||
@@ -999,7 +999,7 @@ FUNCTION ntocdowtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "ntocdow(n) returns the name of the day number n"
|
||||
@ 5, 10 SAY "NToCDoW(n) returns the name of the day number n"
|
||||
@ 6, 10 SAY "Test it, Insert a day number"
|
||||
@ 6, 60 GET cDay
|
||||
|
||||
@@ -1037,9 +1037,9 @@ FUNCTION ntocdowtest()
|
||||
FUNCTION ntocmthtest()
|
||||
|
||||
//
|
||||
// cMonth := ntocmonth( nMonthNum )
|
||||
// cMonth := NToCMonth( nMonthNum )
|
||||
// ==================================
|
||||
// ntocmonth() receives the number of a month and returns its
|
||||
// NToCMonth() receives the number of a month and returns its
|
||||
// name as a string. This version does not observe the Nations
|
||||
// module. English only.
|
||||
|
||||
@@ -1049,7 +1049,7 @@ FUNCTION ntocmthtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "ntocmonth(n) returns the name of the month number n"
|
||||
@ 5, 10 SAY "NToCMonth(n) returns the name of the month number n"
|
||||
@ 6, 10 SAY "Test it, Insert a month number"
|
||||
@ 6, 60 GET cMonth
|
||||
|
||||
@@ -1087,7 +1087,7 @@ FUNCTION ntocmthtest()
|
||||
FUNCTION qtrtest()
|
||||
|
||||
//
|
||||
// nqtr := quarter( dDate )
|
||||
// nqtr := Quarter( dDate )
|
||||
// ===========================
|
||||
// Returns the quarter as a number. If no date is specified,
|
||||
// the system date is used.
|
||||
@@ -1098,7 +1098,7 @@ FUNCTION qtrtest()
|
||||
LOCAL nKey
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "quarter(dDate) returns the number of the quarter"
|
||||
@ 5, 10 SAY "Quarter(dDate) returns the number of the quarter"
|
||||
@ 6, 10 SAY "Test it, Insert a date"
|
||||
@ 6, 52 GET dDate
|
||||
|
||||
@@ -1213,7 +1213,7 @@ FUNCTION chkansi( cAnsidate )
|
||||
FUNCTION weektest()
|
||||
|
||||
//
|
||||
// nWeek := week( dDate, lSWN )
|
||||
// nWeek := Week( dDate, lSWN )
|
||||
// =============================
|
||||
// Returns the calendar week as a number. If no date is specified,
|
||||
// the system date is used. An empty date viz stod()
|
||||
@@ -1226,7 +1226,7 @@ FUNCTION weektest()
|
||||
LOCAL cMode := Space( 1 )
|
||||
|
||||
DO WHILE c
|
||||
@ 5, 10 SAY "week(dDate, lSWN) returns the calendar number of the week"
|
||||
@ 5, 10 SAY "Week(dDate, lSWN) returns the calendar number of the week"
|
||||
@ 6, 10 SAY "if lSWN == .T., the simple week number is returned"
|
||||
@ 7, 10 SAY "if lSWN == .F.(default), the ISO8601 week number is returned"
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ PROCEDURE Main()
|
||||
? 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. ) )
|
||||
// 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 ) + " "
|
||||
?? " Infinity(.T.): " + Str( Mantissa( Infinity( .T. ) ), 20, 15 ) + " "
|
||||
? Str( Exponent( Infinity( .T. ) ), 4 )
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -78,7 +78,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"
|
||||
? "Payment( 2000.00, 0.10 / 12, 24 ) = 92.290 // CT3"
|
||||
? Space( 28 ), Payment( 2000.00, 0.10 / 12, 24 ), " <-- CT for Harbour"
|
||||
?
|
||||
? " PRESS ANY KEY"
|
||||
@@ -88,14 +88,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"
|
||||
? "Periods( 4000.00, 200.00, 0.095 / 12 ) = 21.859 // CT3"
|
||||
? 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"
|
||||
? "Rate( 2500.00, 86.67, 36 ) * 12 = 0.1501 // CT3"
|
||||
? Space( 24 ), Rate( 2500.00, 86.67, 36 ) * 12.0, " <-- CT for Harbour"
|
||||
?
|
||||
? " PRESS ANY KEY"
|
||||
|
||||
@@ -63,99 +63,99 @@ PROCEDURE Main()
|
||||
? "Test of mathematical functions"
|
||||
?
|
||||
|
||||
? "FLOOR( 1.9 ) = 1 // CT3"
|
||||
? "Floor( 1.9 ) = 1 // CT3"
|
||||
? Space( 5 ), Floor( 1.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( 1.1 ) = 1 // CT3"
|
||||
? "Floor( 1.1 ) = 1 // CT3"
|
||||
? Space( 5 ), Floor( 1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( 0.9 ) = 0 // CT3"
|
||||
? "Floor( 0.9 ) = 0 // CT3"
|
||||
? Space( 5 ), Floor( 0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( -0.1 ) = -1 // CT3"
|
||||
? "Floor( -0.1 ) = -1 // CT3"
|
||||
? Space( 7 ), Floor( -0.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( -0.9 ) = -1 // CT3"
|
||||
? "Floor( -0.9 ) = -1 // CT3"
|
||||
? Space( 7 ), Floor( -0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FLOOR( -1.1 ) = -2 // CT3"
|
||||
? "Floor( -1.1 ) = -2 // CT3"
|
||||
? Space( 7 ), Floor( -1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
? "CEILING( 1.9 ) = 2 // CT3"
|
||||
? "Ceiling( 1.9 ) = 2 // CT3"
|
||||
? Space( 7 ), Ceiling( 1.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( 1.1 ) = 2 // CT3"
|
||||
? "Ceiling( 1.1 ) = 2 // CT3"
|
||||
? Space( 7 ), Ceiling( 1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( 0.9 ) = 1 // CT3"
|
||||
? "Ceiling( 0.9 ) = 1 // CT3"
|
||||
? Space( 7 ), Ceiling( 0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( -0.1 ) = 0 // CT3"
|
||||
? "Ceiling( -0.1 ) = 0 // CT3"
|
||||
? Space( 8 ), Ceiling( -0.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( -0.9 ) = 0 // CT3"
|
||||
? "Ceiling( -0.9 ) = 0 // CT3"
|
||||
? Space( 8 ), Ceiling( -0.9 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "CEILING( -1.1 ) = -1 // CT3"
|
||||
? "Ceiling( -1.1 ) = -1 // CT3"
|
||||
? Space( 9 ), Ceiling( -1.1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
? "LOG10( 0.01 ) = -2.00 // CT3"
|
||||
? "Log10( 0.01 ) = -2.00 // CT3"
|
||||
? Space( 7 ), Log10( 0.01 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "LOG10( 2 ) = 0.30 // CT3"
|
||||
? "Log10( 2 ) = 0.30 // CT3"
|
||||
? Space( 3 ), Log10( 2 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "LOG10( 100 ) = 2.00 // CT3"
|
||||
? "Log10( 100 ) = 2.00 // CT3"
|
||||
? Space( 5 ), Log10( 100 ), " <-- CT for Harbour"
|
||||
?
|
||||
?
|
||||
|
||||
? "SIGN( 48335 ) = 1 // CT3"
|
||||
? "Sign( 48335 ) = 1 // CT3"
|
||||
? Space( 6 ), Sign( 48335 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "SIGN( -258 ) = -1 // CT3"
|
||||
? "Sign( -258 ) = -1 // CT3"
|
||||
? Space( 6 ), Sign( -258 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
SET DECIMALS TO 0
|
||||
? "FACT( 1 ) = 1 // CT3"
|
||||
? "Fact( 1 ) = 1 // CT3"
|
||||
? Space( 2 ), Fact( 1 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 5 ) = 120 // CT3"
|
||||
? "Fact( 5 ) = 120 // CT3"
|
||||
? Space( 4 ), Fact( 5 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 21 ) = 51090942171709440000 // CT3"
|
||||
? "Fact( 21 ) = 51090942171709440000 // CT3"
|
||||
? Space( 12 ), Fact( 21 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 25 ) = -1 // CT3"
|
||||
? "Fact( 25 ) = -1 // CT3"
|
||||
? Space( 4 ), Fact( 25 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "FACT( 0 ) = 1 // CT3"
|
||||
? "Fact( 0 ) = 1 // CT3"
|
||||
? Space( 2 ), Fact( 0 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
|
||||
@@ -60,38 +60,38 @@ PROCEDURE Main()
|
||||
|
||||
?? "Test of Numeric functions - part 1"
|
||||
|
||||
? "CELSIUS( 33.8 ) = 1 // CT3"
|
||||
? "Celsius( 33.8 ) = 1 // CT3"
|
||||
? Space( 10 ), Celsius( 33.8 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "CELSIUS( 338.0 ) = 170 // CT3"
|
||||
? "Celsius( 338.0 ) = 170 // CT3"
|
||||
? Space( 11 ), Celsius( 338.0 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "CELSIUS( 3380.0 ) = 1860 // CT3"
|
||||
? "Celsius( 3380.0 ) = 1860 // CT3"
|
||||
? Space( 12 ), Celsius( 3380.0 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "CELSIUS( -33.8 ) = -36.5555.. // CT3"
|
||||
? "Celsius( -33.8 ) = -36.5555.. // CT3"
|
||||
? Space( 10 ), Celsius( -33.8 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "FAHRENHEIT( 12.5 ) = 54.5 // CT3"
|
||||
? "Fahrenheit( 12.5 ) = 54.5 // CT3"
|
||||
? Space( 12 ), Fahrenheit( 12.5 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "FAHRENHEIT( 125 ) = 257 // CT3"
|
||||
? "Fahrenheit( 125 ) = 257 // CT3"
|
||||
? Space( 12 ), Fahrenheit( 125 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "FAHRENHEIT( 1250 ) = 2282 // CT3"
|
||||
? "Fahrenheit( 1250 ) = 2282 // CT3"
|
||||
? Space( 14 ), Fahrenheit( 1250 ), " <-- CT for Harbour "
|
||||
?
|
||||
? "FAHRENHEIT( -155 ) = -247 // CT3"
|
||||
? "Fahrenheit( -155 ) = -247 // CT3"
|
||||
? Space( 14 ), Fahrenheit( -155 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "INFINITY() // CT3"
|
||||
? "Infinity() // CT3"
|
||||
? Space( 8 ), Str( Infinity(), 30, 15 ), " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function NUMTOKEN()
|
||||
* Test CT3 function NumToken()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,14 +58,14 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of NUMTOKEN()"
|
||||
? "Begin test of NumToken()"
|
||||
?
|
||||
|
||||
// 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 + '"'
|
||||
@@ -77,7 +77,7 @@ PROCEDURE Main()
|
||||
? ' skip width = 3: ' + Str( NumToken( cStr, "!", 3 ) )
|
||||
|
||||
?
|
||||
? "End test of NUMTOKEN()"
|
||||
? "End test of NumToken()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function RANGEREM()
|
||||
* Test CT3 function RangeRem()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,7 +56,7 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of RANGEREM()"
|
||||
? "Begin test of RangeRem()"
|
||||
?
|
||||
|
||||
? ' RangeRem( "0", "9", "year2002.dbf" ) == "year.dbf" ? --> "' + ;
|
||||
@@ -67,7 +67,7 @@ PROCEDURE Main()
|
||||
RangeRem( "0", "9", "yearcurr.dbf" ) + '"'
|
||||
|
||||
?
|
||||
? "End test of RANGEREM()"
|
||||
? "End test of RangeRem()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function RANGEREPL()
|
||||
* Test CT3 function RangeRepl()
|
||||
*
|
||||
* Copyright 2002 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,7 +56,7 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of RANGEREPL()"
|
||||
? "Begin test of RangeRepl()"
|
||||
?
|
||||
|
||||
? ' RangeRepl( "0", "9", "year2002.dbf", "?" ) == "year????.dbf" ? --> "' + ;
|
||||
@@ -67,7 +67,7 @@ PROCEDURE Main()
|
||||
RangeRepl( "0", "9", "yearcurr.dbf", "?" ) + '"'
|
||||
|
||||
?
|
||||
? "End test of RANGEREPL()"
|
||||
? "End test of RangeRepl()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function SETATLIKE()
|
||||
* Test CT3 function SetAtLike()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,7 +58,7 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of SETATLIKE()"
|
||||
? "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()
|
||||
@@ -68,9 +68,9 @@ PROCEDURE Main()
|
||||
? " Default wildcard character should be '?', is................", cWildcard
|
||||
SetAtLike( , "#" )
|
||||
SetAtLike( , @cWildcard )
|
||||
? " Setting wildcard to '#' and calling SETATLIKE(,@cWildcard)"
|
||||
? " Setting wildcard to '#' and calling SetAtLike(,@cWildcard)"
|
||||
? " should yield '#' for cWildcard, does......................", cWildcard
|
||||
? "End test of SETATLIKE()"
|
||||
? "End test of SetAtLike()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function STRDIFF()
|
||||
* Test CT3 function StrDiff()
|
||||
*
|
||||
* Copyright 2002 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,20 +56,20 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of STRDIFF()"
|
||||
? "Begin test of StrDiff()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of StrDiff()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 functions TABEXPAND() and TABPACK()
|
||||
* Test CT3 functions TabExpand() and TabPack()
|
||||
*
|
||||
* Copyright 2002 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,17 +58,17 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of TABEXPAND()"
|
||||
? "Begin test of TabExpand()"
|
||||
?
|
||||
|
||||
// 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"
|
||||
@@ -79,36 +79,36 @@ PROCEDURE Main()
|
||||
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)+ "!",, "+")'
|
||||
? ' TabExpand("-"+Chr(9)+"!"+hb_eol()+"----"+Chr(9)+ "!",, "+")'
|
||||
? ' == "-+++++++!"+hb_eol()+"----++++!" ? -> "' + cStr + '"'
|
||||
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)+ "!",, "+", "$")'
|
||||
? ' TabExpand("-"+Chr(9)+"!$$--"+hb_eol()+--"+Chr(9)+ "!",, "+", "$")'
|
||||
nLen := Len( hb_eol() )
|
||||
? ' == "-+++++++!$$--"+hb_eol()+"' + Replicate( "-", 4 - nLen ) + '++!" ? -> "' + cStr + '"'
|
||||
?
|
||||
|
||||
? "Tests with tab characters:"
|
||||
? ' tabexpand("-"+chr(9)+"-",,"+") == "-+++++++-" ? -> "' + TabExpand( "-" + Chr( 9 ) + "-",, "+" ) + '"'
|
||||
? ' tabexpand("-"+chr(9)+"-",,"+",,"-")'
|
||||
? ' TabExpand("-"+Chr(9)+"-",,"+") == "-+++++++-" ? -> "' + TabExpand( "-" + Chr( 9 ) + "-",, "+" ) + '"'
|
||||
? ' TabExpand("-"+Chr(9)+"-",,"+",,"-")'
|
||||
? ' == "++++++++^I+++++++" ? -> "' + StrTran( TabExpand( "-" + Chr( 9 ) + "-",, "+",, "-" ), Chr( 9 ), "^I" ) + '"'
|
||||
?
|
||||
|
||||
? "End test of TABEXPAND()"
|
||||
? "Press any key to continue with tests of TABPACK()..."
|
||||
? "End test of TabExpand()"
|
||||
? "Press any key to continue with tests of TabPack()..."
|
||||
?
|
||||
Inkey( 0 )
|
||||
|
||||
? "Begin test of TABPACK()"
|
||||
? "Begin test of TabPack()"
|
||||
?
|
||||
|
||||
// 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:"
|
||||
@@ -122,10 +122,10 @@ PROCEDURE Main()
|
||||
cStr := StrTran( cStr, Chr( 10 ), "^J" )
|
||||
cStr := StrTran( cStr, Chr( 13 ), "^M" )
|
||||
cStr := StrTran( cStr, Chr( 9 ), "^I" )
|
||||
? ' tabpack("ABCD+" + hb_eol() + "++---+++++", 4, "+")'
|
||||
? ' == "ABCD+"+hb_eol()+"++---"+chr(9)+"++" ? -> "' + cStr + '"'
|
||||
? ' TabPack("ABCD+" + hb_eol() + "++---+++++", 4, "+")'
|
||||
? ' == "ABCD+"+hb_eol()+"++---"+Chr(9)+"++" ? -> "' + cStr + '"'
|
||||
|
||||
? "End test of TABPACK()"
|
||||
? "End test of TabPack()"
|
||||
?
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function TOKEN()
|
||||
* Test CT3 function Token()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -65,15 +65,15 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of TOKEN()"
|
||||
? "Begin test of Token()"
|
||||
?
|
||||
|
||||
// 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 + '"'
|
||||
@@ -94,7 +94,7 @@ PROCEDURE Main()
|
||||
NEXT
|
||||
|
||||
?
|
||||
? "End test of TOKEN()"
|
||||
? "End test of Token()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 functions
|
||||
* - TOKENINIT()
|
||||
* - TOKENEXIT()
|
||||
* - TOKENNEXT()
|
||||
* - TOKENNUM()
|
||||
* - TOKENAT()
|
||||
* - SAVETOKEN()
|
||||
* - RESTTOKEN()
|
||||
* - TOKENEND()
|
||||
* - TokenInit()
|
||||
* - TokenExit()
|
||||
* - TokenNext()
|
||||
* - TokenNum()
|
||||
* - TokenAt()
|
||||
* - SaveToken()
|
||||
* - RestToken()
|
||||
* - TokenEnd()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -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() )
|
||||
? ' TokenInit(@cStr1, ",", 1) == .T. ? ----> ' + LToC( TokenInit( @cStr1, ",", 1 ) )
|
||||
? ' TokenNum() == 6 ? ---------------------> ' + Str( TokenNum() )
|
||||
? ' TokenEnd() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext(@cStr1) ------------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
? ' TokenNext(@cStr1) ------------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' TokenEnd() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
?
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
? ' rewind with TokenInit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' TokenEnd() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext(@cStr1) ------------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( 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() )
|
||||
? ' rewind with TokenInit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' TokenEnd() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext(@cStr3) ------------------> "' + TokenNext( @cStr3 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
? ' TokenNext(@cStr3) ------------------> "' + TokenNext( @cStr3 ) + '"'
|
||||
? ' TokenEnd() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
ENDDO
|
||||
?
|
||||
? ' rewind with tokeninit() == .T. ? ------> ' + LToC( TokenInit() )
|
||||
? ' 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. ) )
|
||||
? ' start & end with TokenAt(.F./.T.)-----> ' + Str( TokenAt() ) + ' ' + Str( TokenAt( .T. ) )
|
||||
TokenNext( @cStr1 )
|
||||
? ' tokenend() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
? ' 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..."
|
||||
@@ -130,20 +130,20 @@ PROCEDURE Main()
|
||||
|
||||
? ' Save global token environment with 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 a different string, cStr4 := "' + cStr4 + '", with TokenInit()'
|
||||
? ' 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() )
|
||||
? ' TokenNum() == 6 ? ----------------------> ' + Str( TokenNum() )
|
||||
? ' TokenEnd() ? -------------------------> ' + LToC( TokenEnd() )
|
||||
WHILE ! TokenEnd()
|
||||
? ' tokennext( @cStr1 ) -----------------> "' + TokenNext( @cStr1 ) + '"'
|
||||
? ' tokenend() ? -------------------------> ' + LToC( 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 ) )
|
||||
? ' 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 ) )
|
||||
? ' compiled with TokenNext( cStr4,, @cTE1 ) + ":" + TokenNext( cStr5,, @cTE2 )'
|
||||
? ' TokenEnd( @cTE1 ) ? ---------------------> ' + LToC( TokenEnd( @cTE1 ) )
|
||||
? ' TokenEnd( @cTE2 ) ? ---------------------> ' + LToC( TokenEnd( @cTE2 ) )
|
||||
ENDDO
|
||||
|
||||
?
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function TOKENLOWER()
|
||||
* Test CT3 function TokenLower()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,30 +58,30 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of TOKENLOWER()"
|
||||
? "Begin test of TokenLower()"
|
||||
?
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' tokenlower("Hello, World, here I am!") == "hello, world, here i am!" ?'
|
||||
? ' TokenLower("Hello, World, here I am!") == "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) == "hello, world, here I am!" ?'
|
||||
? ' -> "' + 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) == "hello, World, here I am!" ?'
|
||||
? ' -> "' + 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") == "hello, World, here i am!" ?'
|
||||
? ' -> "' + TokenLower( "Hello, World, here I am!", " W" ) + '"'
|
||||
?
|
||||
|
||||
? ' Lowercase the tokens in the string "' + cStr + '"'
|
||||
? ' with csetref(.T.) and "@"'
|
||||
? ' with CSetRef(.T.) and "@"'
|
||||
CSetRef( .T. )
|
||||
?
|
||||
? ' --> return value of tokenlower(@cStr): ', TokenLower( @cStr )
|
||||
? ' --> return value of TokenLower(@cStr): ', TokenLower( @cStr )
|
||||
? ' --> cStr is now: "' + cStr + '"'
|
||||
|
||||
?
|
||||
? "End test of TOKENLOWER()"
|
||||
? "End test of TokenLower()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function TOKENSEP()
|
||||
* Test CT3 function TokenSep()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -63,7 +63,7 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of TOKENSEP()"
|
||||
? "Begin test of TokenSep()"
|
||||
?
|
||||
|
||||
// Some simple tests
|
||||
@@ -85,7 +85,7 @@ PROCEDURE Main()
|
||||
NEXT
|
||||
|
||||
?
|
||||
? "End test of TOKENSEP()"
|
||||
? "End test of TokenSep()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function TOKENUPPER()
|
||||
* Test CT3 function TokenUpper()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -58,30 +58,30 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of TOKENUPPER()"
|
||||
? "Begin test of TokenUpper()"
|
||||
?
|
||||
|
||||
// Some simple tests
|
||||
? " Simple tests:"
|
||||
? ' tokenupper("Hello, world, here I am!") == "Hello, World, Here I Am!" ?'
|
||||
? ' TokenUpper("Hello, world, here I am!") == "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) == "Hello, World, Here I am!" ?'
|
||||
? ' -> "' + 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) == "Hello, world, here I am!" ?'
|
||||
? ' -> "' + 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") == "Hello, wOrld, Here I Am!" ?'
|
||||
? ' -> "' + TokenUpper( "Hello, world, here I am!", " w" ) + '"'
|
||||
?
|
||||
|
||||
? ' Uppercase the tokens in the string "' + cStr + '"'
|
||||
? ' with csetref(.T.) and "@"'
|
||||
? ' with CSetRef(.T.) and "@"'
|
||||
CSetRef( .T. )
|
||||
?
|
||||
? ' --> return value of tokenupper(@cStr): ', TokenUpper( @cStr )
|
||||
? ' --> return value of TokenUpper(@cStr): ', TokenUpper( @cStr )
|
||||
? ' --> cStr is now: "' + cStr + '"'
|
||||
|
||||
?
|
||||
? "End test of TOKENUPPER()"
|
||||
? "End test of TokenUpper()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -73,41 +73,41 @@ PROCEDURE Main()
|
||||
?
|
||||
? "PI = " + Str( Pi(), 18, 15 )
|
||||
|
||||
? "STR( SIN( Pi() / 4 ), 18, 15 ) = 0.707106781186548 // CT3"
|
||||
? "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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "STR( Cos( 0 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? Space( 26 ) + Str( Cos( 0 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( COS( Pi() / 4 ), 18, 15 ) = 0.707106781186548 // CT3"
|
||||
? "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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "STR( Cos( Pi() / 9 ), 18, 15 ) = 0.939692620785908 // CT3"
|
||||
? Space( 33 ) + Str( Cos( Pi() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
@@ -115,44 +115,44 @@ PROCEDURE Main()
|
||||
WAIT4()
|
||||
|
||||
|
||||
? "STR( TAN( 0 ), 18, 15 ) = 1.000000000000000 // CT3 wrong ! "
|
||||
? "STR( Tan( 0 ), 18, 15 ) = 1.000000000000000 // CT3 wrong ! "
|
||||
? Space( 26 ) + Str( Tan( 0 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
? "STR( TAN( Pi() / 4 ), 18, 15 ) = 1.000000000000000 // CT3"
|
||||
? "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"
|
||||
? "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"
|
||||
? "STR( ASin( 0.5 ), 18, 15 ) = 0.523598775598299 // CT3"
|
||||
? 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"
|
||||
? "STR( ACos( 0.7 ), 18, 15 ) = 0.795398830184144 // CT3"
|
||||
? 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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "STR( Cot( Pi() / 9 ), 18, 15 ) = 2.747477419454622 // CT3"
|
||||
? Space( 33 ) + Str( Cot( Pi() / 9 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
@@ -160,30 +160,30 @@ PROCEDURE Main()
|
||||
|
||||
?? "Testing Hiperbolic Sine..."
|
||||
?
|
||||
? "STR( SINH( Pi() / 2 ), 18, 15 ) = 2.301298902307295 // CT3"
|
||||
? "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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "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"
|
||||
? "STR( Tanh( Pi() / 4 ), 18, 15 ) = 0.655794202632672 // CT3"
|
||||
? Space( 34 ) + Str( Tanh( Pi() / 4 ), 18, 15 ) + " <-- CT for Harbour"
|
||||
?
|
||||
|
||||
@@ -191,23 +191,23 @@ PROCEDURE Main()
|
||||
|
||||
? "Testing Degree TO Radian..."
|
||||
?
|
||||
? "STR( DTOR( 360 ), 18, 15 ) = 6.283185307179588 // CT3"
|
||||
? "STR( DToR( 360 ), 18, 15 ) = 6.283185307179588 // CT3"
|
||||
? Space( 28 ) + Str( DToR( 360 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( 180 ), 18, 15 ) = 3.141592653589794 // CT3"
|
||||
? "STR( DToR( 180 ), 18, 15 ) = 3.141592653589794 // CT3"
|
||||
? Space( 28 ) + Str( DToR( 180 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( 180.5 ), 18, 15 ) = 3.150319299849766 // CT3"
|
||||
? "STR( DToR( 180.5 ), 18, 15 ) = 3.150319299849766 // CT3"
|
||||
? Space( 30 ) + Str( DToR( 180.5 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( 720 ), 18, 15 ) = 12.566370614359180 // CT3"
|
||||
? "STR( DToR( 720 ), 18, 15 ) = 12.566370614359180 // CT3"
|
||||
? Space( 29 ) + Str( DToR( 720 ), 18, 15 ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
? "STR( DTOR( -180 ), 18, 15 ) = -3.141592653589794 // CT3"
|
||||
? "STR( DToR( -180 ), 18, 15 ) = -3.141592653589794 // CT3"
|
||||
? Space( 30 ) + Str( DToR( -180 ), 18, 15 ), " <-- CT for Harbour "
|
||||
|
||||
WAIT4()
|
||||
@@ -215,38 +215,38 @@ PROCEDURE Main()
|
||||
|
||||
? "Testing Radian TO Degree..."
|
||||
?
|
||||
? "RTOD( Pi() ) = 180 // CT3 "
|
||||
? "RToD( Pi() ) = 180 // CT3 "
|
||||
? Space( 7 ), RToD( Pi() ), " <-- CT for Harbour "
|
||||
|
||||
? "RTOD( 2 * Pi() ) = 360 // CT3 "
|
||||
? "RToD( 2 * Pi() ) = 360 // CT3 "
|
||||
? Space( 11 ), RToD( 2 * Pi() ), " <-- CT for Harbour "
|
||||
|
||||
? "RTOD( 4 * Pi() ) = 720 // CT3 "
|
||||
? "RToD( 4 * Pi() ) = 720 // CT3 "
|
||||
? Space( 11 ), RToD( 4 * Pi() ), " <-- CT for Harbour "
|
||||
|
||||
? "RTOD( -Pi() ) = -180 // CT3"
|
||||
? "RToD( -Pi() ) = -180 // CT3"
|
||||
? Space( 9 ), RToD( -Pi() ), " <-- CT for Harbour "
|
||||
?
|
||||
|
||||
WAIT4()
|
||||
|
||||
|
||||
/* NOTE: ATN2( x, y) have the parameters inverted, when
|
||||
/* NOTE: Atn2( x, y) have the parameters inverted, when
|
||||
comparing with the standard C languaje ATAN2( y, x)
|
||||
*/
|
||||
|
||||
|
||||
? "Testing ATN2( x, y )... where:"
|
||||
? "Testing Atn2( x, y )... where:"
|
||||
|
||||
x := Sin( DToR( 30 ) )
|
||||
y := Cos( DToR( 30 ) )
|
||||
? "x = SIN( DTOR( 30 ) ) =", x
|
||||
? "y = COS( DTOR( 30 ) ) =", y
|
||||
? "x = Sin( DToR( 30 ) ) =", x
|
||||
? "y = Cos( DToR( 30 ) ) =", y
|
||||
?
|
||||
? "STR( ATN2( x, y ), 18, 15 ) = 0.523598775598299 // CT3"
|
||||
? "STR( Atn2( x, y ), 18, 15 ) = 0.523598775598299 // CT3"
|
||||
? 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()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function VALPOS()
|
||||
* Test CT3 function ValPos()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of VALPOS()"
|
||||
? "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()"
|
||||
? "End test of ValPos()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function WORDONE()
|
||||
* Test CT3 function WordOne()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,17 +56,17 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of WORDONE()"
|
||||
? "Begin test of WordOne()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of WordOne()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function WORDONLY()
|
||||
* Test CT3 function WordOnly()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of WORDONLY()"
|
||||
? "Begin test of WordOnly()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of WordOnly()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function WORDREM()
|
||||
* Test CT3 function WordRem()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of WORDREM()"
|
||||
? "Begin test of WordRem()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of WordRem()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function WORDREPL()
|
||||
* Test CT3 function WordRepl()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,23 +56,23 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of WORDREPL()"
|
||||
? "Begin test of WordRepl()"
|
||||
?
|
||||
|
||||
// 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.:"
|
||||
? " 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. ) + '"'
|
||||
? ' WordRepl("aa", "1aaaa", "ba") == "1abaa" ? --> "' + WordRepl( "aa", "1aaaa", "ba" ) + '"'
|
||||
? ' WordRepl("aa", "1aaaa", "ba", .T.) == "1bbba" ? --> "' + WordRepl( "aa", "1aaaa", "ba", .T. ) + '"'
|
||||
?
|
||||
|
||||
? "End test of WORDREPL()"
|
||||
? "End test of WordRepl()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Test CT3 function WORDSWAP()
|
||||
* Test CT3 function WordSwap()
|
||||
*
|
||||
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
|
||||
* Author: Martin Vogel <vogel@inttec.de>
|
||||
@@ -56,16 +56,16 @@ PROCEDURE Main()
|
||||
|
||||
ctinit()
|
||||
|
||||
? "Begin test of WORDSWAP()"
|
||||
? "Begin test of WordSwap()"
|
||||
?
|
||||
|
||||
// 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()"
|
||||
? "End test of WordSwap()"
|
||||
?
|
||||
|
||||
ctexit()
|
||||
|
||||
Reference in New Issue
Block a user