2012-10-24 00:18 UTC+0200 Viktor Szakats (harbour syenar.net)

* src/rtl/hbdoc.prg
    % changed to save NFDOCs without the '*'
      prepended in each line. It was making
      editing much more difficult. Padding also
      changed to 3 chars like in every Harbour
      source.

  * contrib/hbct/doc/en/*.txt
  * contrib/hbgd/doc/en/*.txt
  * contrib/hbgt/doc/en/*.txt
  * contrib/hbmisc/doc/en/*.txt
  * contrib/hbnf/doc/en/*.txt
  * contrib/hbziparc/doc/en/*.txt
  * contrib/rddads/doc/en/*.txt
    * regenerated using hbdoc API

  * doc/en/*.txt
    * regenerated using hbdoc API
    * restored copyright headers manually

  * src/rtl/tlabel.prg
  * src/rtl/treport.prg
    ! unicode fixes (untested)
    % SubStr( x, 1, y ) -> Left( x, y )
This commit is contained in:
Viktor Szakats
2012-10-23 22:43:55 +00:00
parent 6fe841c614
commit 104bce9689
274 changed files with 78563 additions and 78684 deletions

View File

@@ -16,6 +16,32 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-24 00:18 UTC+0200 Viktor Szakats (harbour syenar.net)
* src/rtl/hbdoc.prg
% changed to save NFDOCs without the '*'
prepended in each line. It was making
editing much more difficult. Padding also
changed to 3 chars like in every Harbour
source.
* contrib/hbct/doc/en/*.txt
* contrib/hbgd/doc/en/*.txt
* contrib/hbgt/doc/en/*.txt
* contrib/hbmisc/doc/en/*.txt
* contrib/hbnf/doc/en/*.txt
* contrib/hbziparc/doc/en/*.txt
* contrib/rddads/doc/en/*.txt
* regenerated using hbdoc API
* doc/en/*.txt
* regenerated using hbdoc API
* restored copyright headers manually
* src/rtl/tlabel.prg
* src/rtl/treport.prg
! unicode fixes (untested)
% SubStr( x, 1, y ) -> Left( x, y )
2012-10-23 23:33 UTC+0200 Viktor Szakats (harbour syenar.net)
* config/detect.mk
* contrib/hbct/print.c

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* ADDASCII()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Add an integer value to an ascii value of a string
* $SYNTAX$
* ADDASCII( <[@]cString>, <nValue>, [<nPosition>], [<lCarryOver>] ) --> cString
* $ARGUMENTS$
* <[@]cString> is the string that should be edited
* <nValue> is a integer value that should be added to the
* ASCII value of the character at the <nPosition>th position
* [<nPosition>] is the position of the character that should be edited.
* If not supplied, the last character of <[@]cString> is
* edited.
* [<lCarryOver>] NEW: is set to .T. if the substring from position 1 to
* position <nPosition> should be treated as an integer
* written to the base 256. Thus, the addition of <nValue>
* can affect to whole substring (see EXAMPLES).
* Default is .F., the original behaviour of this function.
* $RETURNS$
* The edited string is returned. The return value can be suppressed by
* using the CSETREF() function. The string must then be passed by
* reference [@].
* $DESCRIPTION$
* ADDASCII() can be used to add or subtract integer values from
* ASCII values in a string. The new <lCarryOver> parameter allows
* to treat a string as an integer written to the base 256. Since
* <nValue> is limited to a signed long, only substrings 4 characters
* long can be affected by one ADDASCII() call.
* If the length of <[@]cString> is smaller than <nPosition>, the
* string remains unchanged. The same happens, if uninterpretable
* parameters are passed to this function.
* $EXAMPLES$
* // Add 32 to the ASCII value of the character at the last position
* // in the string
*
* ? addascii( "SmitH", 32 ) // --> "Smith"
* $TESTS$
* addascii( "0000", 1, 1 ) == "1000"
* addascii( "0000", 1 ) == "0001"
* addascii( "AAAA", -255, 1 ) == "BAAA"
* addascii( "AAAA", -255 ) == "AAAB"
* addascii( "AAAA", 1, 2, .T. ) == "ABAA"
* addascii( "AAAA", 257, 2, .T. ) == "BBAA"
* addascii( "AAAA", 257, 2, .F. ) == "ABAA"
* addascii( "AAAA", 258,, .T. ) == "AABC"
* addascii( "ABBA", -257, 3, .T. ) == "AAAA"
* $STATUS$
* Ready
* $COMPLIANCE$
* ADDASCII() is compatible with CT3's ADDASCII().
* A new, 4th, parameter has been added who defaults to the original
* behaviour if omitted.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
ADDASCII()
$CATEGORY$
CT3 string functions
$ONELINER$
Add an integer value to an ascii value of a string
$SYNTAX$
ADDASCII( <[@]cString>, <nValue>, [<nPosition>], [<lCarryOver>] ) --> cString
$ARGUMENTS$
<[@]cString> is the string that should be edited
<nValue> is a integer value that should be added to the
ASCII value of the character at the <nPosition>th position
[<nPosition>] is the position of the character that should be edited.
If not supplied, the last character of <[@]cString> is
edited.
[<lCarryOver>] NEW: is set to .T. if the substring from position 1 to
position <nPosition> should be treated as an integer
written to the base 256. Thus, the addition of <nValue>
can affect to whole substring (see EXAMPLES).
Default is .F., the original behaviour of this function.
$RETURNS$
The edited string is returned. The return value can be suppressed by
using the CSETREF() function. The string must then be passed by
reference [@].
$DESCRIPTION$
ADDASCII() can be used to add or subtract integer values from
ASCII values in a string. The new <lCarryOver> parameter allows
to treat a string as an integer written to the base 256. Since
<nValue> is limited to a signed long, only substrings 4 characters
long can be affected by one ADDASCII() call.
If the length of <[@]cString> is smaller than <nPosition>, the
string remains unchanged. The same happens, if uninterpretable
parameters are passed to this function.
$EXAMPLES$
// Add 32 to the ASCII value of the character at the last position
// in the string
? addascii( "SmitH", 32 ) // --> "Smith"
$TESTS$
addascii( "0000", 1, 1 ) == "1000"
addascii( "0000", 1 ) == "0001"
addascii( "AAAA", -255, 1 ) == "BAAA"
addascii( "AAAA", -255 ) == "AAAB"
addascii( "AAAA", 1, 2, .T. ) == "ABAA"
addascii( "AAAA", 257, 2, .T. ) == "BBAA"
addascii( "AAAA", 257, 2, .F. ) == "ABAA"
addascii( "AAAA", 258,, .T. ) == "AABC"
addascii( "ABBA", -257, 3, .T. ) == "AAAA"
$STATUS$
Ready
$COMPLIANCE$
ADDASCII() is compatible with CT3's ADDASCII().
A new, 4th, parameter has been added who defaults to the original
behaviour if omitted.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CSETREF()
$END$
*/

View File

@@ -2,40 +2,40 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* ASCIISUM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* calculate the sum of the ASCII values of the characters in a string
* $SYNTAX$
* ASCIISUM( <cString> ) --> nAsciiSum
* $ARGUMENTS$
* <cString> the string to be processed
* $RETURNS$
* <nAsciiSum> sum of the ASCII values in <cString>
* $DESCRIPTION$
* The ASCIISUM() function sums up the ASCII values of the characters
* in <cString>. Be aware that the function is not position sensitive,
* i.e. a change of position of a certain character in the string does
* not change the ascii sum.
* $EXAMPLES$
* ? asciisum( "ABC" ) // --> 197
* ? asciisum( "ACB" ) // --> 197
* $TESTS$
* asciisum( Replicate( "A", 10000 ) ) == 650000
* asciisum( "0123456789" ) == 525
* asciisum( NIL ) == 0
* $STATUS$
* Ready
* $COMPLIANCE$
* ASCIISUM() is compatible with CT3's ASCIISUM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHECKSUM()
* $END$
/* $DOC$
$FUNCNAME$
ASCIISUM()
$CATEGORY$
CT3 string functions
$ONELINER$
calculate the sum of the ASCII values of the characters in a string
$SYNTAX$
ASCIISUM( <cString> ) --> nAsciiSum
$ARGUMENTS$
<cString> the string to be processed
$RETURNS$
<nAsciiSum> sum of the ASCII values in <cString>
$DESCRIPTION$
The ASCIISUM() function sums up the ASCII values of the characters
in <cString>. Be aware that the function is not position sensitive,
i.e. a change of position of a certain character in the string does
not change the ascii sum.
$EXAMPLES$
? asciisum( "ABC" ) // --> 197
? asciisum( "ACB" ) // --> 197
$TESTS$
asciisum( Replicate( "A", 10000 ) ) == 650000
asciisum( "0123456789" ) == 525
asciisum( NIL ) == 0
$STATUS$
Ready
$COMPLIANCE$
ASCIISUM() is compatible with CT3's ASCIISUM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHECKSUM()
$END$
*/

View File

@@ -2,84 +2,84 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* ASCPOS()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* ASCII value of a character at a certain position
* $SYNTAX$
* ASCPOS( <cString>, [<nPosition>] ) --> nAsciiValue
* $ARGUMENTS$
* <cString> is the processed string
* [<nPosition>] is an optional position within <cString>
* Default: last position in <cString>
* $RETURNS$
* <nAsciiValue> the ASCII value of the character at the specified
* position
* $DESCRIPTION$
* The ASCPOS() function returns the ASCII value of the character that
* can be found at the position <nPosition> in <cString>. If <nPosition>
* is larger than the length of <cString>, 0 is returned.
* $EXAMPLES$
* ? ascpos( "0123456789" ) // --> 57
* ? ascpos( "0123456789", 1 ) // --> 48
* $TESTS$
* ascpos( "0123456789" ) == 57
* ascpos( "0123456789", 1 ) == 48
* ascpos( "0123456789", 11 ) == 0 // <nPosition> to large !
* $STATUS$
* Ready
* $COMPLIANCE$
* ASCPOS() is compatible with CT3's ASCPOS().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* VALPOS()
* $END$
/* $DOC$
$FUNCNAME$
ASCPOS()
$CATEGORY$
CT3 string functions
$ONELINER$
ASCII value of a character at a certain position
$SYNTAX$
ASCPOS( <cString>, [<nPosition>] ) --> nAsciiValue
$ARGUMENTS$
<cString> is the processed string
[<nPosition>] is an optional position within <cString>
Default: last position in <cString>
$RETURNS$
<nAsciiValue> the ASCII value of the character at the specified
position
$DESCRIPTION$
The ASCPOS() function returns the ASCII value of the character that
can be found at the position <nPosition> in <cString>. If <nPosition>
is larger than the length of <cString>, 0 is returned.
$EXAMPLES$
? ascpos( "0123456789" ) // --> 57
? ascpos( "0123456789", 1 ) // --> 48
$TESTS$
ascpos( "0123456789" ) == 57
ascpos( "0123456789", 1 ) == 48
ascpos( "0123456789", 11 ) == 0 // <nPosition> to large !
$STATUS$
Ready
$COMPLIANCE$
ASCPOS() is compatible with CT3's ASCPOS().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
VALPOS()
$END$
*/
/* $DOC$
* $FUNCNAME$
* VALPOS()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Numerical value of a character at a certain position
* $SYNTAX$
* VALPOS( <cString>, [<nPosition>] ) --> nDigitValue
* $ARGUMENTS$
* <cString> is the processed string
* [<nPosition>] is an optional position within <cString>
* Default: last position in <cString>
* $RETURNS$
* <nDigitValue> the numerical value of the character at the specified
* position
* $DESCRIPTION$
* The VALPOS() function returns the numerical value of the character that
* can be found at the position <nPosition> in <cString>. If no digit
* can be found at this position or if <nPosition>
* is larger than the length of <cString>, 0 is returned.
* $EXAMPLES$
* ? valpos( "1234x56789" ) // --> 9
* ? valpos( "1234x56789", 1 ) // --> 1
* $TESTS$
* valpos( "1234x56789" ) == 9
* valpos( "1234x56789", 1 ) == 1
* valpos( "1234x56789", 11 ) == 0 // <nPosition> to large !
* valpos( "1234x56789", 5 ) == 0 // "x" is not a digit !
* $STATUS$
* Ready
* $COMPLIANCE$
* VALPOS() is compatible with CT3's VALPOS().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ASCPOS()
* $END$
/* $DOC$
$FUNCNAME$
VALPOS()
$CATEGORY$
CT3 string functions
$ONELINER$
Numerical value of a character at a certain position
$SYNTAX$
VALPOS( <cString>, [<nPosition>] ) --> nDigitValue
$ARGUMENTS$
<cString> is the processed string
[<nPosition>] is an optional position within <cString>
Default: last position in <cString>
$RETURNS$
<nDigitValue> the numerical value of the character at the specified
position
$DESCRIPTION$
The VALPOS() function returns the numerical value of the character that
can be found at the position <nPosition> in <cString>. If no digit
can be found at this position or if <nPosition>
is larger than the length of <cString>, 0 is returned.
$EXAMPLES$
? valpos( "1234x56789" ) // --> 9
? valpos( "1234x56789", 1 ) // --> 1
$TESTS$
valpos( "1234x56789" ) == 9
valpos( "1234x56789", 1 ) == 1
valpos( "1234x56789", 11 ) == 0 // <nPosition> to large !
valpos( "1234x56789", 5 ) == 0 // "x" is not a digit !
$STATUS$
Ready
$COMPLIANCE$
VALPOS() is compatible with CT3's VALPOS().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ASCPOS()
$END$
*/

View File

@@ -2,46 +2,46 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* ATADJUST()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Adjusts a sequence within a string to a specified position
* $SYNTAX$
* ATADJUST( <cStringToMatch>, <cString>, <nAdjustPosition>,
* [<nCounter>], [<nIgnore>],
* [<nFillChar|cFillChar>] ) -> cString
* $ARGUMENTS$
* <cStringToMatch> is the sequence to be adjusted within <cString>
* <cString> is the string that contains <cStringToMatch>
* <nAdjustPosition> specifies the position to that <cStringToMatch>
* will be adjusted
* [<nCounter>] specifies which occurence of <cStringToMatch>
* in <cString> is to be adjusted
* Default: last occurence
* [<nIgnore>] specifies how many characters should be omitted
* in the scan
* [<nFillChar|cFillChar>] specifies the character that is used for the
* adjustment
* $RETURNS$
* cString the changed string
* $DESCRIPTION$
* <TODO: add a description, some examples and tests here>
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* ATADJUST() works like CT3's ATADJUST()
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* SETATLIKE(),CSETATMUPA()
* $END$
/* $DOC$
$FUNCNAME$
ATADJUST()
$CATEGORY$
CT3 string functions
$ONELINER$
Adjusts a sequence within a string to a specified position
$SYNTAX$
ATADJUST( <cStringToMatch>, <cString>, <nAdjustPosition>,
[<nCounter>], [<nIgnore>],
[<nFillChar|cFillChar>] ) -> cString
$ARGUMENTS$
<cStringToMatch> is the sequence to be adjusted within <cString>
<cString> is the string that contains <cStringToMatch>
<nAdjustPosition> specifies the position to that <cStringToMatch>
will be adjusted
[<nCounter>] specifies which occurence of <cStringToMatch>
in <cString> is to be adjusted
Default: last occurence
[<nIgnore>] specifies how many characters should be omitted
in the scan
[<nFillChar|cFillChar>] specifies the character that is used for the
adjustment
$RETURNS$
cString the changed string
$DESCRIPTION$
<TODO: add a description, some examples and tests here>
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
ATADJUST() works like CT3's ATADJUST()
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
SETATLIKE(),CSETATMUPA()
$END$
*/

View File

@@ -2,169 +2,169 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* AFTERATNUM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Returns string portion after nth occurence of substring
* $SYNTAX$
* AFTERATNUM( <cStringToMatch>, <cString>, [<nCounter>],
* [<nIgnore>] ) --> cRestString
* $ARGUMENTS$
* <cStringToMatch> is the substring scanned for
* <cString> is the scanned string
* [<nCounter>] determines how many occurences are of
* <cStringToMatch> in <cString> are searched
* Default: search last occurence
* [<nIgnore>] determines how many character from the start
* should be ignored in the search
* Default: 0
* $RETURNS$
* <cRestString> the portion of <cString> after the <nCounter>th
* occurence of <cStringToMatch> in <cString>
* If such a rest does not exist, an empty string
* is returned.
* $DESCRIPTION$
* This function scans <cString> for <cStringToMatch>. After the
* <nCounter>th match (or the last one, depending on the value of
* <nCounter>) has been found, the portion of
* <cString> after that match will be returned. If there aren't enough
* matches or the last match is identical to the end of <cString>, an
* empty string will be returned.
* After a match has been found, the function continues to scan after
* that match if the CSETATMUPA() switch is turned off, with the
* second character of the matched substring otherwise.
* The function will also consider the settings of SETATLIKE().
* $EXAMPLES$
* ? AFTERATNUM( "!", "What is the answer ? 4 ! 5 !" ) // -> ""
* ? AFTERATNUM( "!", "What is the answer ? 4 ! 5 ?" ) // -> " 5 ?"
* <TODO: add some examples here with csetatmupa() and setatlike()>
* $TESTS$
* AFTERATNUM( "..", "..This..is..a..test!" ) == "test!"
* AFTERATNUM( "..", "..This..is..a..test!", 2 ) == "is..a..test!"
* AFTERATNUM( "..", "..This..is..a..test!", 2, 2 ) == "a..test!"
* $STATUS$
* Ready
* $COMPLIANCE$
* AFTERATNUM() is compatible with CT3's AFTERATNUM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ATNUM(),BEFORATNUM(),CSETATMUPA(),SETATLIKE()
* $END$
/* $DOC$
$FUNCNAME$
AFTERATNUM()
$CATEGORY$
CT3 string functions
$ONELINER$
Returns string portion after nth occurence of substring
$SYNTAX$
AFTERATNUM( <cStringToMatch>, <cString>, [<nCounter>],
[<nIgnore>] ) --> cRestString
$ARGUMENTS$
<cStringToMatch> is the substring scanned for
<cString> is the scanned string
[<nCounter>] determines how many occurences are of
<cStringToMatch> in <cString> are searched
Default: search last occurence
[<nIgnore>] determines how many character from the start
should be ignored in the search
Default: 0
$RETURNS$
<cRestString> the portion of <cString> after the <nCounter>th
occurence of <cStringToMatch> in <cString>
If such a rest does not exist, an empty string
is returned.
$DESCRIPTION$
This function scans <cString> for <cStringToMatch>. After the
<nCounter>th match (or the last one, depending on the value of
<nCounter>) has been found, the portion of
<cString> after that match will be returned. If there aren't enough
matches or the last match is identical to the end of <cString>, an
empty string will be returned.
After a match has been found, the function continues to scan after
that match if the CSETATMUPA() switch is turned off, with the
second character of the matched substring otherwise.
The function will also consider the settings of SETATLIKE().
$EXAMPLES$
? AFTERATNUM( "!", "What is the answer ? 4 ! 5 !" ) // -> ""
? AFTERATNUM( "!", "What is the answer ? 4 ! 5 ?" ) // -> " 5 ?"
<TODO: add some examples here with csetatmupa() and setatlike()>
$TESTS$
AFTERATNUM( "..", "..This..is..a..test!" ) == "test!"
AFTERATNUM( "..", "..This..is..a..test!", 2 ) == "is..a..test!"
AFTERATNUM( "..", "..This..is..a..test!", 2, 2 ) == "a..test!"
$STATUS$
Ready
$COMPLIANCE$
AFTERATNUM() is compatible with CT3's AFTERATNUM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ATNUM(),BEFORATNUM(),CSETATMUPA(),SETATLIKE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* BEFORATNUM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Returns string portion before nth occurence of substring
* $SYNTAX$
* BEFORATNUM( <cStringToMatch>, <cString>, [<nCounter>],
* [<nIgnore>] ) --> cRestString
* $ARGUMENTS$
* <cStringToMatch> is the substring scanned for
* <cString> is the scanned string
* [<nCounter>] determines how many occurences are of
* <cStringToMatch> in <cString> are searched
* Default: search last occurence
* [<nIgnore>] determines how many character from the start
* should be ignored in the search
* Default: 0
* $RETURNS$
* <cRestString> the portion of <cString> before the <nCounter>th
* occurence of <cStringToMatch> in <cString>
* If such a string does not exist, an empty string
* is returned.
* $DESCRIPTION$
* This function scans <cString> for <cStringToMatch>. After the
* <nCounter>th match (or the last one, depending on the value of
* <nCounter>) has been found, the portion of
* <cString> before that match will be returned. If there aren't enough
* matches or the last match is identical to the start of <cString>
* (i.e. the last match is the first match), an empty string will be returned.
* After a match has been found, the function continues to scan after
* that match if the CSETATMUPA() switch is turned off, with the
* second character of the matched substring otherwise.
* The function will also consider the settings of SETATLIKE().
* $EXAMPLES$
* ? BEFORATNUM( "!", "What is the answer ? 4 ! 5 !" ) // -> "What is the answer ? 4 ! 5 "
* ? BEFORATNUM( "!", "What is the answer ? 4 ! 5 ?" ) // -> "What is the answer ? 4 "
* <TODO: add some examples here with csetatmupa() and setatlike()>
* $TESTS$
* BEFORATNUM( "..", "..This..is..a..test!" ) == "..This..is..a"
* BEFORATNUM( "..", "..This..is..a..test!", 2 ) == "..This"
* BEFORATNUM( "..", "..This..is..a..test!", 2, 2 ) == "..This..is"
* $STATUS$
* Ready
* $COMPLIANCE$
* BEFORATNUM() is compatible with CT3's BEFORATNUM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
* $END$
/* $DOC$
$FUNCNAME$
BEFORATNUM()
$CATEGORY$
CT3 string functions
$ONELINER$
Returns string portion before nth occurence of substring
$SYNTAX$
BEFORATNUM( <cStringToMatch>, <cString>, [<nCounter>],
[<nIgnore>] ) --> cRestString
$ARGUMENTS$
<cStringToMatch> is the substring scanned for
<cString> is the scanned string
[<nCounter>] determines how many occurences are of
<cStringToMatch> in <cString> are searched
Default: search last occurence
[<nIgnore>] determines how many character from the start
should be ignored in the search
Default: 0
$RETURNS$
<cRestString> the portion of <cString> before the <nCounter>th
occurence of <cStringToMatch> in <cString>
If such a string does not exist, an empty string
is returned.
$DESCRIPTION$
This function scans <cString> for <cStringToMatch>. After the
<nCounter>th match (or the last one, depending on the value of
<nCounter>) has been found, the portion of
<cString> before that match will be returned. If there aren't enough
matches or the last match is identical to the start of <cString>
(i.e. the last match is the first match), an empty string will be returned.
After a match has been found, the function continues to scan after
that match if the CSETATMUPA() switch is turned off, with the
second character of the matched substring otherwise.
The function will also consider the settings of SETATLIKE().
$EXAMPLES$
? BEFORATNUM( "!", "What is the answer ? 4 ! 5 !" ) // -> "What is the answer ? 4 ! 5 "
? BEFORATNUM( "!", "What is the answer ? 4 ! 5 ?" ) // -> "What is the answer ? 4 "
<TODO: add some examples here with csetatmupa() and setatlike()>
$TESTS$
BEFORATNUM( "..", "..This..is..a..test!" ) == "..This..is..a"
BEFORATNUM( "..", "..This..is..a..test!", 2 ) == "..This"
BEFORATNUM( "..", "..This..is..a..test!", 2, 2 ) == "..This..is"
$STATUS$
Ready
$COMPLIANCE$
BEFORATNUM() is compatible with CT3's BEFORATNUM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ATNUM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Returns the start position of the nth occurence of a substring in a string
* $SYNTAX$
* ATNUM (<cStringToMatch>, <cString>, [<nCounter>],
* [<nIgnore>] ) --> nPosition
* $ARGUMENTS$
* <cStringToMatch> is the substring scanned for
* <cString> is the scanned string
* [<nCounter>] determines how many occurences are of
* <cStringToMatch> in <cString> are searched
* Default: search last occurence
* [<nIgnore>] determines how many character from the start
* should be ignored in the search
* Default: 0
* $RETURNS$
* <nPosition> the position of the <nCounter>th
* occurence of <cStringToMatch> in <cString>.
* If such an occurence does not exist, 0
* is returned.
* $DESCRIPTION$
* This function scans <cString> for <cStringToMatch>. After the
* <nCounter>th match (or the last one, depending on the value of
* <nCounter>) has been found, the position of
* that match will be returned. If there aren't enough
* matches or there is no last match, 0 will be returned.
* After a match has been found, the function continues to scan after
* that match if the CSETATMUPA() switch is turned off, with the
* second character of the matched substring otherwise.
* The function will also consider the settings of SETATLIKE().
* $EXAMPLES$
* ? ATNUM( "!", "What is the answer ? 4 ! 5 !" ) // -> 28
* ? ATNUM( "!", "What is the answer ? 4 ! 5 ?" ) // -> 24
* <TODO: add some examples here with csetatmupa() and setatlike()>
* $TESTS$
* ATNUM( "..", "..This..is..a..test!" ) == 14
* ATNUM( "..", "..This..is..a..test!", 2 ) == 7
* ATNUM( "..", "..This..is..a..test!", 2, 2 ) == 11
* $STATUS$
* Ready
* $COMPLIANCE$
* ATNUM() is compatible with CT3's ATNUM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
* $END$
/* $DOC$
$FUNCNAME$
ATNUM()
$CATEGORY$
CT3 string functions
$ONELINER$
Returns the start position of the nth occurence of a substring in a string
$SYNTAX$
ATNUM (<cStringToMatch>, <cString>, [<nCounter>],
[<nIgnore>] ) --> nPosition
$ARGUMENTS$
<cStringToMatch> is the substring scanned for
<cString> is the scanned string
[<nCounter>] determines how many occurences are of
<cStringToMatch> in <cString> are searched
Default: search last occurence
[<nIgnore>] determines how many character from the start
should be ignored in the search
Default: 0
$RETURNS$
<nPosition> the position of the <nCounter>th
occurence of <cStringToMatch> in <cString>.
If such an occurence does not exist, 0
is returned.
$DESCRIPTION$
This function scans <cString> for <cStringToMatch>. After the
<nCounter>th match (or the last one, depending on the value of
<nCounter>) has been found, the position of
that match will be returned. If there aren't enough
matches or there is no last match, 0 will be returned.
After a match has been found, the function continues to scan after
that match if the CSETATMUPA() switch is turned off, with the
second character of the matched substring otherwise.
The function will also consider the settings of SETATLIKE().
$EXAMPLES$
? ATNUM( "!", "What is the answer ? 4 ! 5 !" ) // -> 28
? ATNUM( "!", "What is the answer ? 4 ! 5 ?" ) // -> 24
<TODO: add some examples here with csetatmupa() and setatlike()>
$TESTS$
ATNUM( "..", "..This..is..a..test!" ) == 14
ATNUM( "..", "..This..is..a..test!", 2 ) == 7
ATNUM( "..", "..This..is..a..test!", 2, 2 ) == 11
$STATUS$
Ready
$COMPLIANCE$
ATNUM() is compatible with CT3's ATNUM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
$END$
*/

View File

@@ -2,67 +2,67 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* ATREPL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Search and replace sequences in a string
* $SYNTAX$
* ATREPL( <cStringToMatch>, <cString>, <cReplacement>, [<nCounter>],
* [<lMode>], [<nIgnore>] ) --> cString
* $ARGUMENTS$
* <cStringToMatch> is the substring searched for in <cString>
* <cString> is the processed string
* <cReplacement> is the replacement for sequences found
* [<nCounter>] specifies the number of replacements
* Default: last occurence
* [<lMode>] if set to .T., only the <nCounter>th sequence
* of <cStringToMatch> will be replaced, else
* all sequences will be replaced.
* Default: .F.
* [<nIgnore>]) specifies how many characters in <cString> from
* the beginning should be ignored by the function
* Default: 0
* $RETURNS$
* <cString>
* $DESCRIPTION$
* The ATREPL() function searches and replaces sequences in a string.
* First, the function ignores the first <nIgnore> characters of <cString>.
* Then, if <lMode> is set to .T., it searches for the <nCounter>th
* occurence of <cStringToMatch> in <cString>. If successful, the
* sequence will be replaced with <cReplacement>.
* If <lMode> is set to .F., the same search is performed, but EVERY
* occurence of <cStringToMatch> till the <nCounter>th (inclusive) will
* be replaced with <cReplacement>. Note that, in this case,
* the replacements are performed even if the <nCounter>th occurence
* does not exist.
* By using the CSETATMUPA() switch you can decide whether the
* function restarts searching after a found sequence of after
* the first character of that sequence.
* The function allows the use of wildcards in <cStringToMatch>
* and looks for the settings of SETATLIKE().
* $EXAMPLES$
* ? ATREPL( "ABC", "ABCDABCDABC", "xx" ) // --> "xxDxxDxx"
* ? ATREPL( "ABC", "ABCDABC", "ZYXW" ) // --> "ZYXWDZYXW"
* ? ATREPL( "ABC", "ABCDABCDABC", "xx", 2 ) // --> "xxDxxDABC"
* ? ATREPL( "ABC", "ABCDABCDABC", "xx", 2, .T. ) // --> "ABCDxxDABC"
* $TESTS$
* ATREPL( "ABC", "ABCDABCDABC", "xx" ) == "xxDxxDxx"
* ATREPL( "ABC", "ABCDABC", "ZYXW" ) == "ZYXWDZYXW"
* ATREPL( "ABC", "ABCDABCDABC", "xx", 2 ) == "xxDxxDABC"
* ATREPL( "ABC", "ABCDABCDABC", "xx", 2, .T. ) == "ABCDxxDABC"
* $STATUS$
* Ready
* $COMPLIANCE$
* ATREPL() is compatible with CT3's ATREPL().
* Note the new, 6th parameter !
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CSETATMUPA() SETATLIKE()
* $END$
/* $DOC$
$FUNCNAME$
ATREPL()
$CATEGORY$
CT3 string functions
$ONELINER$
Search and replace sequences in a string
$SYNTAX$
ATREPL( <cStringToMatch>, <cString>, <cReplacement>, [<nCounter>],
[<lMode>], [<nIgnore>] ) --> cString
$ARGUMENTS$
<cStringToMatch> is the substring searched for in <cString>
<cString> is the processed string
<cReplacement> is the replacement for sequences found
[<nCounter>] specifies the number of replacements
Default: last occurence
[<lMode>] if set to .T., only the <nCounter>th sequence
of <cStringToMatch> will be replaced, else
all sequences will be replaced.
Default: .F.
[<nIgnore>]) specifies how many characters in <cString> from
the beginning should be ignored by the function
Default: 0
$RETURNS$
<cString>
$DESCRIPTION$
The ATREPL() function searches and replaces sequences in a string.
First, the function ignores the first <nIgnore> characters of <cString>.
Then, if <lMode> is set to .T., it searches for the <nCounter>th
occurence of <cStringToMatch> in <cString>. If successful, the
sequence will be replaced with <cReplacement>.
If <lMode> is set to .F., the same search is performed, but EVERY
occurence of <cStringToMatch> till the <nCounter>th (inclusive) will
be replaced with <cReplacement>. Note that, in this case,
the replacements are performed even if the <nCounter>th occurence
does not exist.
By using the CSETATMUPA() switch you can decide whether the
function restarts searching after a found sequence of after
the first character of that sequence.
The function allows the use of wildcards in <cStringToMatch>
and looks for the settings of SETATLIKE().
$EXAMPLES$
? ATREPL( "ABC", "ABCDABCDABC", "xx" ) // --> "xxDxxDxx"
? ATREPL( "ABC", "ABCDABC", "ZYXW" ) // --> "ZYXWDZYXW"
? ATREPL( "ABC", "ABCDABCDABC", "xx", 2 ) // --> "xxDxxDABC"
? ATREPL( "ABC", "ABCDABCDABC", "xx", 2, .T. ) // --> "ABCDxxDABC"
$TESTS$
ATREPL( "ABC", "ABCDABCDABC", "xx" ) == "xxDxxDxx"
ATREPL( "ABC", "ABCDABC", "ZYXW" ) == "ZYXWDZYXW"
ATREPL( "ABC", "ABCDABCDABC", "xx", 2 ) == "xxDxxDABC"
ATREPL( "ABC", "ABCDABCDABC", "xx", 2, .T. ) == "ABCDxxDABC"
$STATUS$
Ready
$COMPLIANCE$
ATREPL() is compatible with CT3's ATREPL().
Note the new, 6th parameter !
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CSETATMUPA() SETATLIKE()
$END$
*/

View File

@@ -2,73 +2,73 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHAREVEN()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Returns the characters on the even positions in a string
* $SYNTAX$
* CHAREVEN( <cString> ) --> cEvenString
* $ARGUMENTS$
* <cString> processed string
* $RETURNS$
* <cEvenString> a string containing all character from even positions
* in <cString>
* $DESCRIPTION$
* The CHAREVEN() function looks for the characters on the even positions
* in a given string, collects them and returns them as a string.
* $EXAMPLES$
* ? CHAREVEN( " H E L L O !" ) // -> "HELLO!"
* $TESTS$
* CHAREVEN( " 1 2 3 4 5" ) == "12345"
* CHAREVEN( " 1 2 3 4 " ) == "1234"
* CHAREVEN( " " ) == ""
* $STATUS$
* Ready
* $COMPLIANCE$
* CHAREVEN() is compatible with CT3's CHAREVEN().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARODD() CHARMIX()
* $END$
/* $DOC$
$FUNCNAME$
CHAREVEN()
$CATEGORY$
CT3 string functions
$ONELINER$
Returns the characters on the even positions in a string
$SYNTAX$
CHAREVEN( <cString> ) --> cEvenString
$ARGUMENTS$
<cString> processed string
$RETURNS$
<cEvenString> a string containing all character from even positions
in <cString>
$DESCRIPTION$
The CHAREVEN() function looks for the characters on the even positions
in a given string, collects them and returns them as a string.
$EXAMPLES$
? CHAREVEN( " H E L L O !" ) // -> "HELLO!"
$TESTS$
CHAREVEN( " 1 2 3 4 5" ) == "12345"
CHAREVEN( " 1 2 3 4 " ) == "1234"
CHAREVEN( " " ) == ""
$STATUS$
Ready
$COMPLIANCE$
CHAREVEN() is compatible with CT3's CHAREVEN().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARODD() CHARMIX()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARODD()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Returns the characters on the odd positions in a string
* $SYNTAX$
* CHARODD( <cString> ) --> cOddString
* $ARGUMENTS$
* <cString> processed string
* $RETURNS$
* <cOddString> a string containing all character from odd positions
* in <cString>
* $DESCRIPTION$
* The CHARODD() function looks for the characters on the odd positions
* in a given string, collects them and returns them as a string.
* $EXAMPLES$
* ? CHARODD( "H E L L O ! " ) // -> "HELLO!"
* $TESTS$
* CHARODD( "1A2B3C4D5E" ) == "12345"
* CHARODD( "1A2B3C4D5" ) == "12345"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARODD() is compatible with CT3's CHARODD().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHAREVEN() CHARMIX()
* $END$
/* $DOC$
$FUNCNAME$
CHARODD()
$CATEGORY$
CT3 string functions
$ONELINER$
Returns the characters on the odd positions in a string
$SYNTAX$
CHARODD( <cString> ) --> cOddString
$ARGUMENTS$
<cString> processed string
$RETURNS$
<cOddString> a string containing all character from odd positions
in <cString>
$DESCRIPTION$
The CHARODD() function looks for the characters on the odd positions
in a given string, collects them and returns them as a string.
$EXAMPLES$
? CHARODD( "H E L L O ! " ) // -> "HELLO!"
$TESTS$
CHARODD( "1A2B3C4D5E" ) == "12345"
CHARODD( "1A2B3C4D5" ) == "12345"
$STATUS$
Ready
$COMPLIANCE$
CHARODD() is compatible with CT3's CHARODD().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHAREVEN() CHARMIX()
$END$
*/

View File

@@ -2,80 +2,80 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARSLIST()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Generates a sorted list of all characters in a string
* $SYNTAX$
* CHARSLIST( [<cString>] ) -> cSortedCharacterList
* $ARGUMENTS$
* [<cString>] is the string for whom the function generates a
* sorted list of all characters
* Default: "" (empty string)
* $RETURNS$
* <cSortedCharacterList> a sorted list of the characters in <cString>
* $DESCRIPTION$
* The CHARLIST() function generates a sorted list of those characters that
* are contained in <cString>. This list can contain each character
* only once, so that its maximum length is 256. The function
* gives the same result as CHARSORT(CHARLIST(<cString>))
* $EXAMPLES$
* ? charslist( "Hello World !" ) // --> " !HWdelor"
* $TESTS$
* charslist( "Hello World !" ) == " !HWdelor"
* charslist( "Hello World !" ) == charsort( charlist( "Hello World !" ) )
* charslist( NIL ) == ""
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARSLIST() is only available in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARNOLIST(),CHARLIST(),CHARHIST()
* $END$
/* $DOC$
$FUNCNAME$
CHARSLIST()
$CATEGORY$
CT3 string functions
$ONELINER$
Generates a sorted list of all characters in a string
$SYNTAX$
CHARSLIST( [<cString>] ) -> cSortedCharacterList
$ARGUMENTS$
[<cString>] is the string for whom the function generates a
sorted list of all characters
Default: "" (empty string)
$RETURNS$
<cSortedCharacterList> a sorted list of the characters in <cString>
$DESCRIPTION$
The CHARLIST() function generates a sorted list of those characters that
are contained in <cString>. This list can contain each character
only once, so that its maximum length is 256. The function
gives the same result as CHARSORT(CHARLIST(<cString>))
$EXAMPLES$
? charslist( "Hello World !" ) // --> " !HWdelor"
$TESTS$
charslist( "Hello World !" ) == " !HWdelor"
charslist( "Hello World !" ) == charsort( charlist( "Hello World !" ) )
charslist( NIL ) == ""
$STATUS$
Ready
$COMPLIANCE$
CHARSLIST() is only available in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARNOLIST(),CHARLIST(),CHARHIST()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARHIST()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Generates a character histogram of a string
* $SYNTAX$
* CHARHIST( [<cString>] ) -> aCharacterCount
* $ARGUMENTS$
* [<cString>] is the string for whom the function generates a
* character histogram
* Default: "" (empty string)
* $RETURNS$
* <aCharacterCount> an array with 256 elements where the nth element
* contains the count of character #(n-1) in cString
* $DESCRIPTION$
* The CHARHIST() function generates a character histogram of those
* characters that are contained in <cString>. This histogram is stored
* in an 256-element array where the nth element contains the count
* of ASCII character #(n-1) in <cString>.
* $EXAMPLES$
* ? charhist( "Hello World !" )[ 109 ] // --> 3 // Chr( 108 ) == "l"
* $TESTS$
* charhist( "Hello World !" )[ 109 ] == 3
* eval( {|| AEval( charhist( "Hello World !" ), {| x | nTotal += x } ), nTotal == Len( "Hello World !" ) }
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARHIST() is only available in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARLIST(),CHARNOLIST(),CHARSLIST()
* $END$
/* $DOC$
$FUNCNAME$
CHARHIST()
$CATEGORY$
CT3 string functions
$ONELINER$
Generates a character histogram of a string
$SYNTAX$
CHARHIST( [<cString>] ) -> aCharacterCount
$ARGUMENTS$
[<cString>] is the string for whom the function generates a
character histogram
Default: "" (empty string)
$RETURNS$
<aCharacterCount> an array with 256 elements where the nth element
contains the count of character #(n-1) in cString
$DESCRIPTION$
The CHARHIST() function generates a character histogram of those
characters that are contained in <cString>. This histogram is stored
in an 256-element array where the nth element contains the count
of ASCII character #(n-1) in <cString>.
$EXAMPLES$
? charhist( "Hello World !" )[ 109 ] // --> 3 // Chr( 108 ) == "l"
$TESTS$
charhist( "Hello World !" )[ 109 ] == 3
eval( {|| AEval( charhist( "Hello World !" ), {| x | nTotal += x } ), nTotal == Len( "Hello World !" ) }
$STATUS$
Ready
$COMPLIANCE$
CHARHIST() is only available in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARLIST(),CHARNOLIST(),CHARSLIST()
$END$
*/

View File

@@ -2,78 +2,78 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARLIST()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Generates a list of all characters in a string
* $SYNTAX$
* CHARLIST( [<cString>] ) -> cCharacterList
* $ARGUMENTS$
* [<cString>] is the string for whom the function generates a list
* of all characters
* Default: "" (empty string)
* $RETURNS$
* <cCharacterList> a list of the characters in <cString>
* $DESCRIPTION$
* The CHARLIST() function generates a list of those characters that
* are contained in <cString>. This list can contain each character
* only once, so that its maximum length is 256. The list lists those
* characters first that are occuring in <cString> first.
* $EXAMPLES$
* ? charlist( "Hello World !" ) // --> "Helo Wrd!"
* $TESTS$
* charlist( "Hello World !" ) == "Helo Wrd!"
* charlist( NIL ) == ""
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARLIST() is compatible with CT3's CHARLIST().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARNOLIST(),CHARSLIST(),CHARHIST()
* $END$
/* $DOC$
$FUNCNAME$
CHARLIST()
$CATEGORY$
CT3 string functions
$ONELINER$
Generates a list of all characters in a string
$SYNTAX$
CHARLIST( [<cString>] ) -> cCharacterList
$ARGUMENTS$
[<cString>] is the string for whom the function generates a list
of all characters
Default: "" (empty string)
$RETURNS$
<cCharacterList> a list of the characters in <cString>
$DESCRIPTION$
The CHARLIST() function generates a list of those characters that
are contained in <cString>. This list can contain each character
only once, so that its maximum length is 256. The list lists those
characters first that are occuring in <cString> first.
$EXAMPLES$
? charlist( "Hello World !" ) // --> "Helo Wrd!"
$TESTS$
charlist( "Hello World !" ) == "Helo Wrd!"
charlist( NIL ) == ""
$STATUS$
Ready
$COMPLIANCE$
CHARLIST() is compatible with CT3's CHARLIST().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARNOLIST(),CHARSLIST(),CHARHIST()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARNOLIST()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Generates a list of all characters not contained in a string
* $SYNTAX$
* CHARNOLIST( [<cString>] ) -> cCharacterList
* $ARGUMENTS$
* [<cString>] is the string for whom the function generates a list
* of all characters not contained in that string
* Default: "" (empty string)
* $RETURNS$
* <cCharacterList> a list of the characters that are not contained in <cString>
* $DESCRIPTION$
* The CHARNOLIST() function generates a list of those characters that
* are not contained in <cString>. This list can contain each character
* only once, so that its maximum length is 256. The list is alphabetically
* sorted.
* $EXAMPLES$
* ? charnolist( charnolist( "Hello World !" ) ) // --> " !HWdelor"
* $TESTS$
* charnolist( charnolist( "Hello World !" ) ) == charslist( "Hello World !" )
* charnolist( charnolist( NIL ) ) == ""
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARNOLIST() is compatible with CT3's CHARNOLIST().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARLIST(),CHARSLIST(),CHARHIST()
* $END$
/* $DOC$
$FUNCNAME$
CHARNOLIST()
$CATEGORY$
CT3 string functions
$ONELINER$
Generates a list of all characters not contained in a string
$SYNTAX$
CHARNOLIST( [<cString>] ) -> cCharacterList
$ARGUMENTS$
[<cString>] is the string for whom the function generates a list
of all characters not contained in that string
Default: "" (empty string)
$RETURNS$
<cCharacterList> a list of the characters that are not contained in <cString>
$DESCRIPTION$
The CHARNOLIST() function generates a list of those characters that
are not contained in <cString>. This list can contain each character
only once, so that its maximum length is 256. The list is alphabetically
sorted.
$EXAMPLES$
? charnolist( charnolist( "Hello World !" ) ) // --> " !HWdelor"
$TESTS$
charnolist( charnolist( "Hello World !" ) ) == charslist( "Hello World !" )
charnolist( charnolist( NIL ) ) == ""
$STATUS$
Ready
$COMPLIANCE$
CHARNOLIST() is compatible with CT3's CHARNOLIST().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARLIST(),CHARSLIST(),CHARHIST()
$END$
*/

View File

@@ -2,47 +2,47 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARMIRR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Mirror a string
* $SYNTAX$
* CHARMIRR( <[@]cString>, [<lDontMirrorSpaces>] ) -> cMirroredString
* $ARGUMENTS$
* <[@]cString> is the string that should be mirrored
* [<lDontMirrorSpaces>] if set to .T., spaces at the end of
* <cString> will not be mirrored but kept at the end
* Default: .F., mirror the whole string
* $RETURNS$
* <cMirroredString> the mirrored string
* $DESCRIPTION$
* The CHARMIRR() function mirrors a string, i.e. the first character
* will be put at the end, the second at the last but one position etc..
* One can use this function for index searches, but then, the spaces
* at the end of the string should not be mirrored.
* One can omit the return value of the function by setting the CSETREF()
* switch to .T., but <cString> must then be passed by reference to get
* a result.
* $EXAMPLES$
* ? charmirr( "racecar" ) // "racecar"
* ? charmirr( "racecar ", .T. ) // "racecar "
* ? charmirr( "racecar ", .F. ) // " racecar"
* $TESTS$
* charmirr( "racecar" ) == "racecar"
* charmirr( "racecar ", .T. ) == "racecar "
* charmirr( "racecar ", .F. ) == " racecar"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARMIRR() is compatible with CT3's CHARMIRR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARMIRR()
$CATEGORY$
CT3 string functions
$ONELINER$
Mirror a string
$SYNTAX$
CHARMIRR( <[@]cString>, [<lDontMirrorSpaces>] ) -> cMirroredString
$ARGUMENTS$
<[@]cString> is the string that should be mirrored
[<lDontMirrorSpaces>] if set to .T., spaces at the end of
<cString> will not be mirrored but kept at the end
Default: .F., mirror the whole string
$RETURNS$
<cMirroredString> the mirrored string
$DESCRIPTION$
The CHARMIRR() function mirrors a string, i.e. the first character
will be put at the end, the second at the last but one position etc..
One can use this function for index searches, but then, the spaces
at the end of the string should not be mirrored.
One can omit the return value of the function by setting the CSETREF()
switch to .T., but <cString> must then be passed by reference to get
a result.
$EXAMPLES$
? charmirr( "racecar" ) // "racecar"
? charmirr( "racecar ", .T. ) // "racecar "
? charmirr( "racecar ", .F. ) // " racecar"
$TESTS$
charmirr( "racecar" ) == "racecar"
charmirr( "racecar ", .T. ) == "racecar "
charmirr( "racecar ", .F. ) == " racecar"
$STATUS$
Ready
$COMPLIANCE$
CHARMIRR() is compatible with CT3's CHARMIRR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CSETREF()
$END$
*/

View File

@@ -2,53 +2,53 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARMIX()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Mix two strings
* $SYNTAX$
* CHARMIX( <cString1>[, <cString2>] ) --> cMixedString
* $ARGUMENTS$
* <cString1> String that will be mixed with the characters from <cString2>
* [<cString2>] String whose characters will be mixed with the one from
* <cString1>.
* Default: " " (string with one space char)
* $RETURNS$
* <cMixedString> Mixed string
* $DESCRIPTION$
* The CHARMIX() function mixes the strings <cString1> and <cString2>. To
* do this it takes one character after the other alternatively from
* <cString1> and <cString2> and puts them in the output string.
* This procedure is stopped when the end of <cString1> is reached. If
* <cString2> is shorter than <cString1>, the function will start at
* the begin of <cString2> again. If on the other hand <cString2> is
* longer than <cString1>, the surplus characters will be omitted.
* $EXAMPLES$
* ? CHARMIX( "ABC", "123" ) // "A1B2C3"
* ? CHARMIX( "ABCDE", "12" ) // "A1B2C1D2E1"
* ? CHARMIX( "AB", "12345" ) // "A1B2"
* ? CHARMIX( "HELLO", " " ) // "H E L L O "
* ? CHARMIX( "HELLO", "" ) // "HELLO"
* $TESTS$
* CHARMIX( "ABC", "123" ) == "A1B2C3"
* CHARMIX( "ABCDE", "12" ) == "A1B2C1D2E1"
* CHARMIX( "AB", "12345") == "A1B2"
* CHARMIX( "HELLO", " " ) == "H E L L O "
* CHARMIX( "HELLO", "" ) == "HELLO"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARMIX() is compatible with CT3's CHARMIX().
* NOTE: CA-Tools version of CHARMIX() will hang
* if the second parameter is an empty string, this version will not.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHAREVEN() CHARODD()
* $END$
/* $DOC$
$FUNCNAME$
CHARMIX()
$CATEGORY$
CT3 string functions
$ONELINER$
Mix two strings
$SYNTAX$
CHARMIX( <cString1>[, <cString2>] ) --> cMixedString
$ARGUMENTS$
<cString1> String that will be mixed with the characters from <cString2>
[<cString2>] String whose characters will be mixed with the one from
<cString1>.
Default: " " (string with one space char)
$RETURNS$
<cMixedString> Mixed string
$DESCRIPTION$
The CHARMIX() function mixes the strings <cString1> and <cString2>. To
do this it takes one character after the other alternatively from
<cString1> and <cString2> and puts them in the output string.
This procedure is stopped when the end of <cString1> is reached. If
<cString2> is shorter than <cString1>, the function will start at
the begin of <cString2> again. If on the other hand <cString2> is
longer than <cString1>, the surplus characters will be omitted.
$EXAMPLES$
? CHARMIX( "ABC", "123" ) // "A1B2C3"
? CHARMIX( "ABCDE", "12" ) // "A1B2C1D2E1"
? CHARMIX( "AB", "12345" ) // "A1B2"
? CHARMIX( "HELLO", " " ) // "H E L L O "
? CHARMIX( "HELLO", "" ) // "HELLO"
$TESTS$
CHARMIX( "ABC", "123" ) == "A1B2C3"
CHARMIX( "ABCDE", "12" ) == "A1B2C1D2E1"
CHARMIX( "AB", "12345") == "A1B2"
CHARMIX( "HELLO", " " ) == "H E L L O "
CHARMIX( "HELLO", "" ) == "HELLO"
$STATUS$
Ready
$COMPLIANCE$
CHARMIX() is compatible with CT3's CHARMIX().
NOTE: CA-Tools version of CHARMIX() will hang
if the second parameter is an empty string, this version will not.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHAREVEN() CHARODD()
$END$
*/

View File

@@ -2,87 +2,87 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARONE()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Reduce multiple occurences of a character to one
* $SYNTAX$
* CHARONE( [<cCharactersToReduce>,] <cString> ) -> cReducedString
* $ARGUMENTS$
* [<cCharactersToReduce>] specifies the characters the multiple
* occurences of which should be reduced to one
* Default: All characters.
* <cString> specifies the processed string
* $RETURNS$
* <cReducedString> the string with the reduced occurences
* $DESCRIPTION$
* The CHARONE() function reduces multiple occurences of characters in
* <cString> to a single one. It is important to note that the multiple
* occurences must occur directly one behind the other. This behaviour is
* is in contrast to the CHARLIST() function.
* $EXAMPLES$
* ? CHARONE( "122333a123" ) // "123a123"
* ? CHARONE( "A B CCCD" ) // "A B CD"
* ? CHARONE( " ", "A B A B" ) // "A B A B"
* ? CHARONE( "o", "122oooB12o" ) // "122oB12o"
* $TESTS$
* CHARONE( "122333a123" ) == "123a123"
* CHARONE( "A B CCCD" ) == "A B CD"
* CHARONE( " ", "A B A B" ) == "A B A B"
* CHARONE( "o", "122oooB12o" ) == "122oB12o"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARONE() is compatible with CT3's CHARONE().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARREM() WORDONE()
* $END$
/* $DOC$
$FUNCNAME$
CHARONE()
$CATEGORY$
CT3 string functions
$ONELINER$
Reduce multiple occurences of a character to one
$SYNTAX$
CHARONE( [<cCharactersToReduce>,] <cString> ) -> cReducedString
$ARGUMENTS$
[<cCharactersToReduce>] specifies the characters the multiple
occurences of which should be reduced to one
Default: All characters.
<cString> specifies the processed string
$RETURNS$
<cReducedString> the string with the reduced occurences
$DESCRIPTION$
The CHARONE() function reduces multiple occurences of characters in
<cString> to a single one. It is important to note that the multiple
occurences must occur directly one behind the other. This behaviour is
is in contrast to the CHARLIST() function.
$EXAMPLES$
? CHARONE( "122333a123" ) // "123a123"
? CHARONE( "A B CCCD" ) // "A B CD"
? CHARONE( " ", "A B A B" ) // "A B A B"
? CHARONE( "o", "122oooB12o" ) // "122oB12o"
$TESTS$
CHARONE( "122333a123" ) == "123a123"
CHARONE( "A B CCCD" ) == "A B CD"
CHARONE( " ", "A B A B" ) == "A B A B"
CHARONE( "o", "122oooB12o" ) == "122oB12o"
$STATUS$
Ready
$COMPLIANCE$
CHARONE() is compatible with CT3's CHARONE().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARREM() WORDONE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* WORDONE()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Reduce multiple occurences of a double character to one
* $SYNTAX$
* WORDONE( [<cDoubleCharactersToReduce>,] <cString> ) -> cReducedString
* $ARGUMENTS$
* [<cDoubleCharactersToReduce>] specifies the double characters the multiple
* occurences of which should be reduced to one
* Default: All characters.
* <cString> specifies the processed string
* $RETURNS$
* <cReducedString> the string with the reduced occurences
* $DESCRIPTION$
* The WORDONE() function reduces multiple occurences of double characters in
* <cString> to a single one. It is important to note that the multiple
* occurences must occur directly one behind the other.
* $EXAMPLES$
* ? WORDONE( "12ABAB12" ) // "12AB12"
* ? WORDONE( "1AAAA2" ) // "1AAAA2"
* ? WORDONE( "12", "1212ABAB" ) // "12ABAB"
* $TESTS$
* WORDONE( "12ABAB12" ) == "12AB12"
* WORDONE( "1AAAA2" ) == "1AAAA2"
* WORDONE( "12", "1212ABAB" ) == "12ABAB"
* $STATUS$
* Ready
* $COMPLIANCE$
* WORDONE() is compatible with CT3's WORDONE().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARONE() CHARREM()
* $END$
/* $DOC$
$FUNCNAME$
WORDONE()
$CATEGORY$
CT3 string functions
$ONELINER$
Reduce multiple occurences of a double character to one
$SYNTAX$
WORDONE( [<cDoubleCharactersToReduce>,] <cString> ) -> cReducedString
$ARGUMENTS$
[<cDoubleCharactersToReduce>] specifies the double characters the multiple
occurences of which should be reduced to one
Default: All characters.
<cString> specifies the processed string
$RETURNS$
<cReducedString> the string with the reduced occurences
$DESCRIPTION$
The WORDONE() function reduces multiple occurences of double characters in
<cString> to a single one. It is important to note that the multiple
occurences must occur directly one behind the other.
$EXAMPLES$
? WORDONE( "12ABAB12" ) // "12AB12"
? WORDONE( "1AAAA2" ) // "1AAAA2"
? WORDONE( "12", "1212ABAB" ) // "12ABAB"
$TESTS$
WORDONE( "12ABAB12" ) == "12AB12"
WORDONE( "1AAAA2" ) == "1AAAA2"
WORDONE( "12", "1212ABAB" ) == "12ABAB"
$STATUS$
Ready
$COMPLIANCE$
WORDONE() is compatible with CT3's WORDONE().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARONE() CHARREM()
$END$
*/

View File

@@ -2,157 +2,157 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARONLY()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Intersectional set of two strings based on characters
* $SYNTAX$
* CHARONLY( <cThisCharactersOnly>, <cString> ) -> cReducedString
* $ARGUMENTS$
* <cThisCharactersOnly> specifies the characters that must not be
* deleted in <cString>.
* <cString> is the string that should be processed
* $RETURNS$
* <cReducedString> A string with all characters deleted but those
* specified in <cThisCharactersOnly>.
* $DESCRIPTION$
* The CHARONLY() function calculates the intersectional set of two
* strings. To do this, it deletes all characters from <cString> that
* do not appear in <cThisCharacterOnly>.
* $EXAMPLES$
* ? CHARONLY( "0123456789", "0211 - 38 99 77" ) // "0211389977"
* ? CHARONLY( "0123456789", "0211/ 389 977" ) // "0211389977"
* $TESTS$
* CHARONLY( "0123456789", "0211 - 38 99 77" ) == "0211389977"
* CHARONLY( "0123456789", "0211/ 389 977" ) == "0211389977"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARONLY() is compatible with CT3's CHARONLY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARREM() WORDONLY() WORDREM()
* $END$
/* $DOC$
$FUNCNAME$
CHARONLY()
$CATEGORY$
CT3 string functions
$ONELINER$
Intersectional set of two strings based on characters
$SYNTAX$
CHARONLY( <cThisCharactersOnly>, <cString> ) -> cReducedString
$ARGUMENTS$
<cThisCharactersOnly> specifies the characters that must not be
deleted in <cString>.
<cString> is the string that should be processed
$RETURNS$
<cReducedString> A string with all characters deleted but those
specified in <cThisCharactersOnly>.
$DESCRIPTION$
The CHARONLY() function calculates the intersectional set of two
strings. To do this, it deletes all characters from <cString> that
do not appear in <cThisCharacterOnly>.
$EXAMPLES$
? CHARONLY( "0123456789", "0211 - 38 99 77" ) // "0211389977"
? CHARONLY( "0123456789", "0211/ 389 977" ) // "0211389977"
$TESTS$
CHARONLY( "0123456789", "0211 - 38 99 77" ) == "0211389977"
CHARONLY( "0123456789", "0211/ 389 977" ) == "0211389977"
$STATUS$
Ready
$COMPLIANCE$
CHARONLY() is compatible with CT3's CHARONLY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARREM() WORDONLY() WORDREM()
$END$
*/
/* $DOC$
* $FUNCNAME$
* WORDONLY()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Intersectional set of two strings based on double characters
* $SYNTAX$
* WORDONLY( <cThisDoubleCharactersOnly>, <cString> ) -> cReducedString
* $ARGUMENTS$
* <cThisDoubleCharactersOnly> specifies the double characters that must
* not be deleted in <cString>.
* <cString> is the string that should be processed
* $RETURNS$
* <cReducedString> A string with all double characters deleted
* but those specified in <cThisCharactersOnly>.
* $DESCRIPTION$
* The WORDONLY() function calculates the intersectional set of two
* strings based on double characters. To do this, it deletes all double
* characters from <cString> that do not appear in <cThisDoubleCharacterOnly>.
* $EXAMPLES$
* ? WORDONLY( "AABBCCDD", "XXAAYYBBZZ" ) // "AABB"
* ? WORDONLY( "AABBCCDD", "XAAYYYBBZZ" ) // "BB"
* $TESTS$
* WORDONLY( "AABBCCDD", "XXAAYYBBZZ" ) == "AABB"
* WORDONLY( "AABBCCDD", "XAAYYYBBZZ" ) == "BB"
* $STATUS$
* Ready
* $COMPLIANCE$
* WORDONLY() is compatible with CT3's WORDONLY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARONLY() CHARREM() WORDREM()
* $END$
/* $DOC$
$FUNCNAME$
WORDONLY()
$CATEGORY$
CT3 string functions
$ONELINER$
Intersectional set of two strings based on double characters
$SYNTAX$
WORDONLY( <cThisDoubleCharactersOnly>, <cString> ) -> cReducedString
$ARGUMENTS$
<cThisDoubleCharactersOnly> specifies the double characters that must
not be deleted in <cString>.
<cString> is the string that should be processed
$RETURNS$
<cReducedString> A string with all double characters deleted
but those specified in <cThisCharactersOnly>.
$DESCRIPTION$
The WORDONLY() function calculates the intersectional set of two
strings based on double characters. To do this, it deletes all double
characters from <cString> that do not appear in <cThisDoubleCharacterOnly>.
$EXAMPLES$
? WORDONLY( "AABBCCDD", "XXAAYYBBZZ" ) // "AABB"
? WORDONLY( "AABBCCDD", "XAAYYYBBZZ" ) // "BB"
$TESTS$
WORDONLY( "AABBCCDD", "XXAAYYBBZZ" ) == "AABB"
WORDONLY( "AABBCCDD", "XAAYYYBBZZ" ) == "BB"
$STATUS$
Ready
$COMPLIANCE$
WORDONLY() is compatible with CT3's WORDONLY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARONLY() CHARREM() WORDREM()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARREM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Removes characters from a string
* $SYNTAX$
* CHARREM( <cDeleteThisCharacters>, <cString> ) -> cReducedString
* $ARGUMENTS$
* <cDeleteThisCharacters> specifies the characters that should
* be deleted in <cString>
* <cString>) is the string that should be processed
* $RETURNS$
* <cReducedString> is a string where the characters specified
* in <cDeleteThisCharacters> are deleted
* $DESCRIPTION$
* The CHARREM() function deletes the characters specified in
* <cDeleteThisCharacters> from <cString>.
* $EXAMPLES$
* ? CHARREM( " ", " 1 2 " ) // "12"
* ? CHARREM( "3y", "xyz123" ) // "xz12"
* $TESTS$
* CHARREM( " ", " 1 2 " ) == "12"
* CHARREM( "3y", "xyz123" ) == "xz12"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARREM() is compatible with CT3's CHARREM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARONLY() WORDONLY() WORDREM()
* $END$
/* $DOC$
$FUNCNAME$
CHARREM()
$CATEGORY$
CT3 string functions
$ONELINER$
Removes characters from a string
$SYNTAX$
CHARREM( <cDeleteThisCharacters>, <cString> ) -> cReducedString
$ARGUMENTS$
<cDeleteThisCharacters> specifies the characters that should
be deleted in <cString>
<cString>) is the string that should be processed
$RETURNS$
<cReducedString> is a string where the characters specified
in <cDeleteThisCharacters> are deleted
$DESCRIPTION$
The CHARREM() function deletes the characters specified in
<cDeleteThisCharacters> from <cString>.
$EXAMPLES$
? CHARREM( " ", " 1 2 " ) // "12"
? CHARREM( "3y", "xyz123" ) // "xz12"
$TESTS$
CHARREM( " ", " 1 2 " ) == "12"
CHARREM( "3y", "xyz123" ) == "xz12"
$STATUS$
Ready
$COMPLIANCE$
CHARREM() is compatible with CT3's CHARREM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARONLY() WORDONLY() WORDREM()
$END$
*/
/* $DOC$
* $FUNCNAME$
* WORDREM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Removes characters from a string
* $SYNTAX$
* WORDREM( <cDeleteThisDoubleCharacters>, <cString> ) -> cReducedString
* $ARGUMENTS$
* <cDeleteThisDoubleCharacters> specifies the double characters that
* should be deleted in <cString>
* <cString>) is the string that should be processed
* $RETURNS$
* <cReducedString> is a string where the double characters
* specified in <cDeleteThisDoubleCharacters>
* are deleted
* $DESCRIPTION$
* The WORDREM() function deletes the double characters specified in
* <cDeleteThisDoubleCharacters> from <cString>.
* $EXAMPLES$
* ? WORDREM( "abcd", "0ab1cd" ) // "0ab1"
* ? WORDREM( "abcd", "ab0cd1" ) // "0cd1"
* $TESTS$
* WORDREM( "abcd", "0ab1cd" ) == "0ab1"
* WORDREM( "abcd", "ab0cd1" ) == "0cd1"
* $STATUS$
* Ready
* $COMPLIANCE$
* WORDREM() is a new function available only in Harbour's CT3.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARONLY CHARREM() WORDREM()
* $END$
/* $DOC$
$FUNCNAME$
WORDREM()
$CATEGORY$
CT3 string functions
$ONELINER$
Removes characters from a string
$SYNTAX$
WORDREM( <cDeleteThisDoubleCharacters>, <cString> ) -> cReducedString
$ARGUMENTS$
<cDeleteThisDoubleCharacters> specifies the double characters that
should be deleted in <cString>
<cString>) is the string that should be processed
$RETURNS$
<cReducedString> is a string where the double characters
specified in <cDeleteThisDoubleCharacters>
are deleted
$DESCRIPTION$
The WORDREM() function deletes the double characters specified in
<cDeleteThisDoubleCharacters> from <cString>.
$EXAMPLES$
? WORDREM( "abcd", "0ab1cd" ) // "0ab1"
? WORDREM( "abcd", "ab0cd1" ) // "0cd1"
$TESTS$
WORDREM( "abcd", "0ab1cd" ) == "0ab1"
WORDREM( "abcd", "ab0cd1" ) == "0cd1"
$STATUS$
Ready
$COMPLIANCE$
WORDREM() is a new function available only in Harbour's CT3.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARONLY CHARREM() WORDREM()
$END$
*/

View File

@@ -2,242 +2,242 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARADD()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Adds corresponding ASCII value of two strings
* $SYNTAX$
* CHARADD( <[@]cString1>, <cString2> ) --> cAddString
* $ARGUMENTS$
* <[@]cString1> first string
* <cString2> second string
* $RETURNS$
* <cAddString> string with added ASCII values
* $DESCRIPTION$
* The CHARADD() function constructs a new string from the two strings
* passed as parameters. To do this, it adds the ASCII values of the
* corresponding characters of both strings and places a character in
* the resulting string whose ASCII value equals to that sum (modulo 256).
* If the first string is passed by reference, the resulting string is
* stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* If <cString2> is shorter than <cString1> and the last character of
* <cString2> has been processed, the function restarts with the first
* character of <cString2>.
* $EXAMPLES$
* ? charadd( "012345678", Chr( 1 ) ) // --> "123456789"
* ? charadd( "123456789", Chr( 255 ) ) // --> "012345678"
* ? charadd( "0000", Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 3 ) ) // --> "0123"
* $TESTS$
* charadd( "012345678", Chr( 1 ) ) == "123456789"
* charadd( "012345678", Chr( 1 ) + Chr( 2 ) ) == "133557799"
* charadd( "123456789", Chr( 255 ) ) == "012345678"
* charadd( "123456789", Chr( 255 ) + Chr( 254 ) ) == "002244668"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARADD() is compatible with CT3's CHARADD().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARSUB() CHARAND() CHARNOT()
* CHAROR() CHARXOR() CHARSHL()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARADD()
$CATEGORY$
CT3 string functions
$ONELINER$
Adds corresponding ASCII value of two strings
$SYNTAX$
CHARADD( <[@]cString1>, <cString2> ) --> cAddString
$ARGUMENTS$
<[@]cString1> first string
<cString2> second string
$RETURNS$
<cAddString> string with added ASCII values
$DESCRIPTION$
The CHARADD() function constructs a new string from the two strings
passed as parameters. To do this, it adds the ASCII values of the
corresponding characters of both strings and places a character in
the resulting string whose ASCII value equals to that sum (modulo 256).
If the first string is passed by reference, the resulting string is
stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If <cString2> is shorter than <cString1> and the last character of
<cString2> has been processed, the function restarts with the first
character of <cString2>.
$EXAMPLES$
? charadd( "012345678", Chr( 1 ) ) // --> "123456789"
? charadd( "123456789", Chr( 255 ) ) // --> "012345678"
? charadd( "0000", Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 3 ) ) // --> "0123"
$TESTS$
charadd( "012345678", Chr( 1 ) ) == "123456789"
charadd( "012345678", Chr( 1 ) + Chr( 2 ) ) == "133557799"
charadd( "123456789", Chr( 255 ) ) == "012345678"
charadd( "123456789", Chr( 255 ) + Chr( 254 ) ) == "002244668"
$STATUS$
Ready
$COMPLIANCE$
CHARADD() is compatible with CT3's CHARADD().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARSUB() CHARAND() CHARNOT()
CHAROR() CHARXOR() CHARSHL()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARAND()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Combine corresponding ASCII value of two strings with bitwise AND
* $SYNTAX$
* CHARAND( <[@]cString1>, <cString2> ) --> cAndString
* $ARGUMENTS$
* <[@]cString1> first string
* <cString2> second string
* $RETURNS$
* <cAndString> string with bitwise AND combined ASCII values
* $DESCRIPTION$
* The CHARAND() function constructs a new string from the two strings
* passed as parameters. To do this, it combines the ASCII values of the
* corresponding characters of both strings with a bitwise AND-operation
* and places a character in the resulting string whose ASCII value
* equals to the result of that operation.
* If the first string is passed by reference, the resulting string is
* stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* If <cString2> is shorter than <cString1> and the last character of
* <cString2> has been processed, the function restarts with the first
* character of <cString2>.
* $EXAMPLES$
* // clear the LSB
* ? charand( "012345678", Chr( 254 ) ) // --> "002244668"
* ? charand( "012345678", Chr( 254 ) + Chr( 252 ) ) // --> "002044648"
* $TESTS$
* charand( "012345678", Chr( 254 ) ) == "002244668"
* charand( "012345678", Chr( 254 ) + Chr( 252 ) ) == "002044648"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARAND() is compatible with CT3's CHARAND().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARNOT()
* CHAROR() CHARXOR() CHARSHL()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARAND()
$CATEGORY$
CT3 string functions
$ONELINER$
Combine corresponding ASCII value of two strings with bitwise AND
$SYNTAX$
CHARAND( <[@]cString1>, <cString2> ) --> cAndString
$ARGUMENTS$
<[@]cString1> first string
<cString2> second string
$RETURNS$
<cAndString> string with bitwise AND combined ASCII values
$DESCRIPTION$
The CHARAND() function constructs a new string from the two strings
passed as parameters. To do this, it combines the ASCII values of the
corresponding characters of both strings with a bitwise AND-operation
and places a character in the resulting string whose ASCII value
equals to the result of that operation.
If the first string is passed by reference, the resulting string is
stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If <cString2> is shorter than <cString1> and the last character of
<cString2> has been processed, the function restarts with the first
character of <cString2>.
$EXAMPLES$
// clear the LSB
? charand( "012345678", Chr( 254 ) ) // --> "002244668"
? charand( "012345678", Chr( 254 ) + Chr( 252 ) ) // --> "002044648"
$TESTS$
charand( "012345678", Chr( 254 ) ) == "002244668"
charand( "012345678", Chr( 254 ) + Chr( 252 ) ) == "002044648"
$STATUS$
Ready
$COMPLIANCE$
CHARAND() is compatible with CT3's CHARAND().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARNOT()
CHAROR() CHARXOR() CHARSHL()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARNOT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Process each character in a string with bitwise NOT operation
* $SYNTAX$
* CHARNOT( <[@]cString> ) --> cNotString
* $ARGUMENTS$
* <[@]cString> string to be processed
* $RETURNS$
* <cNotString> string with bitwise negated characters
* $DESCRIPTION$
* The CHARNOT() function constructs a new string from the string
* passed as parameter. To do this, it performs a bitwise NOT operation
* to the characters of the string and places a character in
* the resulting string whose ASCII value equals to the result of that
* operation. It can be easily seen that the resulting ASCII-value equals
* 255 minus input ASCII value.
* If the string is passed by reference, the resulting string is
* stored in <cString>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* $EXAMPLES$
* ? charnot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) // --> Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 )
* ? charnot( charnot( "This is a test!" ) ) --> "This is a test!"
* $TESTS$
* charnot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) == Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 )
* charnot( charnot( "This is a test!" ) ) == "This is a test!"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARNOT() is compatible with CT3's CHARNOT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARSHL()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARNOT()
$CATEGORY$
CT3 string functions
$ONELINER$
Process each character in a string with bitwise NOT operation
$SYNTAX$
CHARNOT( <[@]cString> ) --> cNotString
$ARGUMENTS$
<[@]cString> string to be processed
$RETURNS$
<cNotString> string with bitwise negated characters
$DESCRIPTION$
The CHARNOT() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise NOT operation
to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation. It can be easily seen that the resulting ASCII-value equals
255 minus input ASCII value.
If the string is passed by reference, the resulting string is
stored in <cString>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
$EXAMPLES$
? charnot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) // --> Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 )
? charnot( charnot( "This is a test!" ) ) --> "This is a test!"
$TESTS$
charnot( Chr( 85 ) + Chr( 128 ) + Chr( 170 ) + Chr( 1 ) ) == Chr( 170 ) + Chr( 127 ) + Chr( 85 ) + Chr( 254 )
charnot( charnot( "This is a test!" ) ) == "This is a test!"
$STATUS$
Ready
$COMPLIANCE$
CHARNOT() is compatible with CT3's CHARNOT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARAND()
CHAROR() CHARXOR() CHARSHL()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHAROR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Combine corresponding ASCII value of two strings with bitwise OR
* $SYNTAX$
* CHAROR( <[@]cString1>, <cString2> ) --> cOrString
* $ARGUMENTS$
* <[@]cString1> first string
* <cString2> second string
* $RETURNS$
* <cOrString> string with bitwise OR combined ASCII values
* $DESCRIPTION$
* The CHAROR() function constructs a new string from the two strings
* passed as parameters. To do this, it combines the ASCII values of the
* corresponding characters of both strings with a bitwise OR-operation
* and places a character in the resulting string whose ASCII value
* equals to the result of that operation.
* If the first string is passed by reference, the resulting string is
* stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* If <cString2> is shorter than <cString1> and the last character of
* <cString2> has been processed, the function restarts with the first
* character of <cString2>.
* $EXAMPLES$
* // set the LSB
* ? charor( "012345678", Chr( 1 ) ) // --> "113355779"
* ? charor( "012345678", Chr( 1 ) + Chr( 3 ) ) // --> "133357779"
* $TESTS$
* charor( "012345678", Chr( 1 ) ) == "113355779"
* charor( "012345678", Chr( 1 ) + Chr( 3 ) ) == "133357779"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHAROR() is compatible with CT3's CHAROR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARNOT()
* CHARAND() CHARXOR() CHARSHL()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHAROR()
$CATEGORY$
CT3 string functions
$ONELINER$
Combine corresponding ASCII value of two strings with bitwise OR
$SYNTAX$
CHAROR( <[@]cString1>, <cString2> ) --> cOrString
$ARGUMENTS$
<[@]cString1> first string
<cString2> second string
$RETURNS$
<cOrString> string with bitwise OR combined ASCII values
$DESCRIPTION$
The CHAROR() function constructs a new string from the two strings
passed as parameters. To do this, it combines the ASCII values of the
corresponding characters of both strings with a bitwise OR-operation
and places a character in the resulting string whose ASCII value
equals to the result of that operation.
If the first string is passed by reference, the resulting string is
stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If <cString2> is shorter than <cString1> and the last character of
<cString2> has been processed, the function restarts with the first
character of <cString2>.
$EXAMPLES$
// set the LSB
? charor( "012345678", Chr( 1 ) ) // --> "113355779"
? charor( "012345678", Chr( 1 ) + Chr( 3 ) ) // --> "133357779"
$TESTS$
charor( "012345678", Chr( 1 ) ) == "113355779"
charor( "012345678", Chr( 1 ) + Chr( 3 ) ) == "133357779"
$STATUS$
Ready
$COMPLIANCE$
CHAROR() is compatible with CT3's CHAROR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARNOT()
CHARAND() CHARXOR() CHARSHL()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARXOR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Combine corresponding ASCII value of two strings with bitwise XOR
* $SYNTAX$
* CHARXOR( <[@]cString1>, <cString2> ) --> cXOrString
* $ARGUMENTS$
* <[@]cString1> first string
* <cString2> second string
* $RETURNS$
* <cXOrString> string with bitwise XOR combined ASCII values
* $DESCRIPTION$
* The CHARXOR() function constructs a new string from the two strings
* passed as parameters. To do this, it combines the ASCII values of the
* corresponding characters of both strings with a bitwise XOR-operation
* and places a character in the resulting string whose ASCII value
* equals to the result of that operation.
* If the first string is passed by reference, the resulting string is
* stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* If <cString2> is shorter than <cString1> and the last character of
* <cString2> has been processed, the function restarts with the first
* character of <cString2>.
* $EXAMPLES$
* // easy encryption
* ? charxor( "This is top secret !", "My Password" ) // --> <encrypted sentence>
* $TESTS$
* charxor( charxor( "This is top secret !", "My Password" ), "My Password" ) == "This is top secret !"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARXOR() is compatible with CT3's CHARXOR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARNOT()
* CHARAND() CHAROR() CHARSHL()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARXOR()
$CATEGORY$
CT3 string functions
$ONELINER$
Combine corresponding ASCII value of two strings with bitwise XOR
$SYNTAX$
CHARXOR( <[@]cString1>, <cString2> ) --> cXOrString
$ARGUMENTS$
<[@]cString1> first string
<cString2> second string
$RETURNS$
<cXOrString> string with bitwise XOR combined ASCII values
$DESCRIPTION$
The CHARXOR() function constructs a new string from the two strings
passed as parameters. To do this, it combines the ASCII values of the
corresponding characters of both strings with a bitwise XOR-operation
and places a character in the resulting string whose ASCII value
equals to the result of that operation.
If the first string is passed by reference, the resulting string is
stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If <cString2> is shorter than <cString1> and the last character of
<cString2> has been processed, the function restarts with the first
character of <cString2>.
$EXAMPLES$
// easy encryption
? charxor( "This is top secret !", "My Password" ) // --> <encrypted sentence>
$TESTS$
charxor( charxor( "This is top secret !", "My Password" ), "My Password" ) == "This is top secret !"
$STATUS$
Ready
$COMPLIANCE$
CHARXOR() is compatible with CT3's CHARXOR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARNOT()
CHARAND() CHAROR() CHARSHL()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/

View File

@@ -2,236 +2,236 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARSUB()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Subtracts corresponding ASCII value of two strings
* $SYNTAX$
* CHARSUB( <[@]cString1>, <cString2>) --> cSubString
* $ARGUMENTS$
* <[@]cString1> first string
* <cString2> second string
* $RETURNS$
* <cSubString> string with subtracted ASCII values
* $DESCRIPTION$
* The CHARSUB() function constructs a new string from the two strings
* passed as parameters. To do this, it subtracts the ASCII values of the
* corresponding characters of both strings and places a character in
* the resulting string whose ASCII value equals to that difference (modulo 256).
* If the first string is passed by reference, the resulting string is
* stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* If <cString2> is shorter than <cString1> and the last character of
* <cString2> has been processed, the function restarts with the first
* character of <cString2>.
* $EXAMPLES$
* ? charsub( "012345678", Chr( 1 ) ) // --> "/01234567"
* ? charsub( "123456789", Chr( 255 ) ) // --> "23456789:"
* ? charsub( "9999", Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 3 ) ) // --> "9876"
* $TESTS$
* charsub( "123456789", Chr( 1 ) ) == "012345678"
* charsub( "123456789", Chr( 1 ) + Chr( 2 ) ) == "002244668"
* charsub( "012345678", Chr( 255 ) ) == "123456789"
* charsub( "012345678", Chr( 255 ) + Chr( 254 ) ) == "133557799"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARSUB() is a new function that is only available in Harbour's CT3 lib.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARAND() CHARNOT()
* CHAROR() CHARXOR() CHARSHL()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARSUB()
$CATEGORY$
CT3 string functions
$ONELINER$
Subtracts corresponding ASCII value of two strings
$SYNTAX$
CHARSUB( <[@]cString1>, <cString2>) --> cSubString
$ARGUMENTS$
<[@]cString1> first string
<cString2> second string
$RETURNS$
<cSubString> string with subtracted ASCII values
$DESCRIPTION$
The CHARSUB() function constructs a new string from the two strings
passed as parameters. To do this, it subtracts the ASCII values of the
corresponding characters of both strings and places a character in
the resulting string whose ASCII value equals to that difference (modulo 256).
If the first string is passed by reference, the resulting string is
stored in <cString1>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If <cString2> is shorter than <cString1> and the last character of
<cString2> has been processed, the function restarts with the first
character of <cString2>.
$EXAMPLES$
? charsub( "012345678", Chr( 1 ) ) // --> "/01234567"
? charsub( "123456789", Chr( 255 ) ) // --> "23456789:"
? charsub( "9999", Chr( 0 ) + Chr( 1 ) + Chr( 2 ) + Chr( 3 ) ) // --> "9876"
$TESTS$
charsub( "123456789", Chr( 1 ) ) == "012345678"
charsub( "123456789", Chr( 1 ) + Chr( 2 ) ) == "002244668"
charsub( "012345678", Chr( 255 ) ) == "123456789"
charsub( "012345678", Chr( 255 ) + Chr( 254 ) ) == "133557799"
$STATUS$
Ready
$COMPLIANCE$
CHARSUB() is a new function that is only available in Harbour's CT3 lib.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARAND() CHARNOT()
CHAROR() CHARXOR() CHARSHL()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARSHL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Process each character in a string with bitwise SHIFT LEFT operation
* $SYNTAX$
* CHARSHL( <[@]cString>, <nBitsToSHL> ) --> cSHLString
* $ARGUMENTS$
* <[@]cString> string to be processed
* <nBitsToSHL> number of bit positions to be shifted to the left
* $RETURNS$
* <cSHLString> string with bitwise shifted left characters
* $DESCRIPTION$
* The CHARSHL() function constructs a new string from the string
* passed as parameter. To do this, it performs a bitwise SHIFT LEFT
* (SHL) operation to the characters of the string and places a character in
* the resulting string whose ASCII value equals to the result of that
* operation.
* Be aware that bits shifted out of the byte are lost. If you need
* a bit rotation, use the CHARRLL() function instead.
* If the string is passed by reference, the resulting string is
* stored in <cString>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* $EXAMPLES$
* ? 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)
* $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)
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARSHL() is a new function that is only available in Harbour's CT3 lib.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
* CHARSHR() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARSHL()
$CATEGORY$
CT3 string functions
$ONELINER$
Process each character in a string with bitwise SHIFT LEFT operation
$SYNTAX$
CHARSHL( <[@]cString>, <nBitsToSHL> ) --> cSHLString
$ARGUMENTS$
<[@]cString> string to be processed
<nBitsToSHL> number of bit positions to be shifted to the left
$RETURNS$
<cSHLString> string with bitwise shifted left characters
$DESCRIPTION$
The CHARSHL() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise SHIFT LEFT
(SHL) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that bits shifted out of the byte are lost. If you need
a bit rotation, use the CHARRLL() function instead.
If the string is passed by reference, the resulting string is
stored in <cString>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
$EXAMPLES$
? 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)
$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)
$STATUS$
Ready
$COMPLIANCE$
CHARSHL() is a new function that is only available in Harbour's CT3 lib.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARAND()
CHAROR() CHARXOR() CHARNOT()
CHARSHR() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARSHR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Process each character in a string with bitwise SHIFT RIGHT operation
* $SYNTAX$
* CHARSHR( <[@]cString>, <nBitsToSHR> ) --> cSHRString
* $ARGUMENTS$
* <[@]cString> string to be processed
* <nBitsToSHR> number of bit positions to be shifted to the right
* $RETURNS$
* <cSHRString> string with bitwise shifted right characters
* $DESCRIPTION$
* The CHARSHR() function constructs a new string from the string
* passed as parameter. To do this, it performs a bitwise SHIFT RIGHT
* (SHR) operation to the characters of the string and places a character in
* the resulting string whose ASCII value equals to the result of that
* operation.
* Be aware that bits shifted out of the byte are lost. If you need
* a bit rotation, use the CHARRLR() function instead.
* If the string is passed by reference, the resulting string is
* stored in <cString>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* $EXAMPLES$
* ? 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)
* $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)
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARSHR() is a new function that is only available in Harbour's CT3 lib.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
* CHARSHL() CHARRLL() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARSHR()
$CATEGORY$
CT3 string functions
$ONELINER$
Process each character in a string with bitwise SHIFT RIGHT operation
$SYNTAX$
CHARSHR( <[@]cString>, <nBitsToSHR> ) --> cSHRString
$ARGUMENTS$
<[@]cString> string to be processed
<nBitsToSHR> number of bit positions to be shifted to the right
$RETURNS$
<cSHRString> string with bitwise shifted right characters
$DESCRIPTION$
The CHARSHR() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise SHIFT RIGHT
(SHR) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that bits shifted out of the byte are lost. If you need
a bit rotation, use the CHARRLR() function instead.
If the string is passed by reference, the resulting string is
stored in <cString>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
$EXAMPLES$
? 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)
$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)
$STATUS$
Ready
$COMPLIANCE$
CHARSHR() is a new function that is only available in Harbour's CT3 lib.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARAND()
CHAROR() CHARXOR() CHARNOT()
CHARSHL() CHARRLL() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARRLL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Process each character in a string with bitwise ROLL LEFT operation
* $SYNTAX$
* CHARRLL( <[@]cString>, <nBitsToRLL> ) --> cRLLString
* $ARGUMENTS$
* <[@]cString> string to be processed
* <nBitsToRLL> number of bit positions to be rolled to the left
* $RETURNS$
* <cRLLString> string with bitwise rolled left characters
* $DESCRIPTION$
* The CHARRLL() function constructs a new string from the string
* passed as parameter. To do this, it performs a bitwise ROLL LEFT
* (RLL) operation to the characters of the string and places a character in
* the resulting string whose ASCII value equals to the result of that
* operation.
* Be aware that, in contrast to CHARSHL(), bits rolled out on
* the left are put in again on the right.
* If the string is passed by reference, the resulting string is
* stored in <cString>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* $EXAMPLES$
* ? 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)
* $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)
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARRLL() is a new function that is only available in Harbour's CT3 lib.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
* CHARSHL() CHARSHR() CHARRLR()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARRLL()
$CATEGORY$
CT3 string functions
$ONELINER$
Process each character in a string with bitwise ROLL LEFT operation
$SYNTAX$
CHARRLL( <[@]cString>, <nBitsToRLL> ) --> cRLLString
$ARGUMENTS$
<[@]cString> string to be processed
<nBitsToRLL> number of bit positions to be rolled to the left
$RETURNS$
<cRLLString> string with bitwise rolled left characters
$DESCRIPTION$
The CHARRLL() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise ROLL LEFT
(RLL) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that, in contrast to CHARSHL(), bits rolled out on
the left are put in again on the right.
If the string is passed by reference, the resulting string is
stored in <cString>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
$EXAMPLES$
? 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)
$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)
$STATUS$
Ready
$COMPLIANCE$
CHARRLL() is a new function that is only available in Harbour's CT3 lib.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARAND()
CHAROR() CHARXOR() CHARNOT()
CHARSHL() CHARSHR() CHARRLR()
CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARRLR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Process each character in a string with bitwise ROLL RIGHT operation
* $SYNTAX$
* CHARRLR( <[@]cString>, <nBitsToRLR> ) --> cRLRString
* $ARGUMENTS$
* <[@]cString> string to be processed
* <nBitsToRLR> number of bit positions to be rolled to the right
* $RETURNS$
* <cRLRString> string with bitwise rolled right characters
* $DESCRIPTION$
* The CHARRLR() function constructs a new string from the string
* passed as parameter. To do this, it performs a bitwise ROLL RIGHT
* (RLR) operation to the characters of the string and places a character in
* the resulting string whose ASCII value equals to the result of that
* operation.
* Be aware that, in contrast to CHARSHR(), bits rolled out on
* the right are put in again on the left.
* If the string is passed by reference, the resulting string is
* stored in <cString>, too. By setting the CSETREF()-switch to .T.,
* the return value can be omitted.
* $EXAMPLES$
* ? 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)
* $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)
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARRLR() is a new function that is only available in Harbour's CT3 lib.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARADD() CHARSUB() CHARAND()
* CHAROR() CHARXOR() CHARNOT()
* CHARSHL() CHARSHR() CHARRLL()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARRLR()
$CATEGORY$
CT3 string functions
$ONELINER$
Process each character in a string with bitwise ROLL RIGHT operation
$SYNTAX$
CHARRLR( <[@]cString>, <nBitsToRLR> ) --> cRLRString
$ARGUMENTS$
<[@]cString> string to be processed
<nBitsToRLR> number of bit positions to be rolled to the right
$RETURNS$
<cRLRString> string with bitwise rolled right characters
$DESCRIPTION$
The CHARRLR() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise ROLL RIGHT
(RLR) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that, in contrast to CHARSHR(), bits rolled out on
the right are put in again on the left.
If the string is passed by reference, the resulting string is
stored in <cString>, too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
$EXAMPLES$
? 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)
$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)
$STATUS$
Ready
$COMPLIANCE$
CHARRLR() is a new function that is only available in Harbour's CT3 lib.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARADD() CHARSUB() CHARAND()
CHAROR() CHARXOR() CHARNOT()
CHARSHL() CHARSHR() CHARRLL()
CSETREF()
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARREPL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replacement of characters
* $SYNTAX$
* CHARREPL( <cSearchString>, <[@]cString>,
* <cReplaceString>, [<lMode>] ) -> cString
* $ARGUMENTS$
* <cSearchString> is a string of characters that should be replaced
* <[@]cString> is the processed string
* <cReplaceString> is a string of characters that replace the one
* of <cSearchString>
* [<lMode>] sets the replacement method (see description)
* Default: .F.
* $RETURNS$
* <cString> the processed string
* $DESCRIPTION$
* The CHARREPL() function replaces certain characters in <cString>
* with others depending on the setting of <lMode>.
* If <lMode> is set to .F., the function takes the characters of
* <cSearchString> one after the other, searches for them in <cString>
* and, if successful, replaces them with the corresponding character
* of <cReplaceString>. Be aware that if the same characters occur
* in both <cSearchString> and <cReplaceString>, the character on a
* certain position in <cString> can be replaced multiple times.
* if <lMode> is set to .T., the function takes the characters in <cString>
* one after the other, searches for them in <cSearchString> and, if
* successful, replaces them with the corresponding character of
* <cReplaceString>. Note that no multiple replacements are possible
* in this mode.
* If <cReplaceString> is shorter than <cSearchString>, the last
* character of <cReplaceString> is used as corresponding character
* for the the "rest" of <cSearchString>.
* One can omit the return value by setting the CSETREF() switch to .T.,
* but then one must pass <cString> by reference to get the result.
* $EXAMPLES$
* ? charrepl( "1234", "1x2y3z", "abcd" ) // "axbycz"
* ? charrepl( "abcdefghij", "jhfdb", "1234567890" ) // "08642"
* ? charrepl( "abcdefghij", "jhfdb", "12345" ) // "55542"
* ? charrepl( "1234", "1234", "234A" ) // "AAAA"
* ? charrepl( "1234", "1234", "234A", .T. ) // "234A"
* $TESTS$
* charrepl( "1234", "1x2y3z", "abcd" ) == "axbycz"
* charrepl( "abcdefghij", "jhfdb", "1234567890" ) == "08642"
* charrepl( "abcdefghij", "jhfdb", "12345" ) == "55542"
* charrepl( "1234", "1234", "234A" ) == "AAAA"
* charrepl( "1234", "1234", "234A", .T. ) == "234A"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARREPL() is compatible with CT3's CHARREPL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* WORDREPL() POSREPL() RANGEREPL()
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARREPL()
$CATEGORY$
CT3 string functions
$ONELINER$
Replacement of characters
$SYNTAX$
CHARREPL( <cSearchString>, <[@]cString>,
<cReplaceString>, [<lMode>] ) -> cString
$ARGUMENTS$
<cSearchString> is a string of characters that should be replaced
<[@]cString> is the processed string
<cReplaceString> is a string of characters that replace the one
of <cSearchString>
[<lMode>] sets the replacement method (see description)
Default: .F.
$RETURNS$
<cString> the processed string
$DESCRIPTION$
The CHARREPL() function replaces certain characters in <cString>
with others depending on the setting of <lMode>.
If <lMode> is set to .F., the function takes the characters of
<cSearchString> one after the other, searches for them in <cString>
and, if successful, replaces them with the corresponding character
of <cReplaceString>. Be aware that if the same characters occur
in both <cSearchString> and <cReplaceString>, the character on a
certain position in <cString> can be replaced multiple times.
if <lMode> is set to .T., the function takes the characters in <cString>
one after the other, searches for them in <cSearchString> and, if
successful, replaces them with the corresponding character of
<cReplaceString>. Note that no multiple replacements are possible
in this mode.
If <cReplaceString> is shorter than <cSearchString>, the last
character of <cReplaceString> is used as corresponding character
for the the "rest" of <cSearchString>.
One can omit the return value by setting the CSETREF() switch to .T.,
but then one must pass <cString> by reference to get the result.
$EXAMPLES$
? charrepl( "1234", "1x2y3z", "abcd" ) // "axbycz"
? charrepl( "abcdefghij", "jhfdb", "1234567890" ) // "08642"
? charrepl( "abcdefghij", "jhfdb", "12345" ) // "55542"
? charrepl( "1234", "1234", "234A" ) // "AAAA"
? charrepl( "1234", "1234", "234A", .T. ) // "234A"
$TESTS$
charrepl( "1234", "1x2y3z", "abcd" ) == "axbycz"
charrepl( "abcdefghij", "jhfdb", "1234567890" ) == "08642"
charrepl( "abcdefghij", "jhfdb", "12345" ) == "55542"
charrepl( "1234", "1234", "234A" ) == "AAAA"
charrepl( "1234", "1234", "234A", .T. ) == "234A"
$STATUS$
Ready
$COMPLIANCE$
CHARREPL() is compatible with CT3's CHARREPL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
WORDREPL() POSREPL() RANGEREPL()
CSETREF()
$END$
*/

View File

@@ -2,83 +2,83 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARSORT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Sort sequences within a string.
* $SYNTAX$
* CHARSORT( <[@]cString>, [<nElementLength>], [<nCompareLength>],
* [<nIgnoreCharacters>], [<nElemenOffset>], [<nSortLength>],
* [<lDescending>] ) -> cSortedString
* $ARGUMENTS$
* <[@]cString> is the string that should be processed
* [<nElementLength>] specifies the length of the elements that
* should be sorted
* Default: 1
* [<nCompareLength>] specifies how many characters within one
* element should be used for comparison
* Default: <nElementLength>
* [<nIgnoreCharacters>] specifies the number of characters at the
* beginning of <cString> that should be ignored
* in the sort process
* Default: 0
* [<nElementOffset>] specifies the offset of the comparison string
* within a element
* Default: 0
* [<nSortLength>] specifies how many characters in <cString>,
* starting from the <nIgnoreCharacters> position,
* should be sorted
* Default: len(cString)-nIgnoreCharacters
* [<lDescending>]) specifies whether the process should
* sort descending or not
* $RETURNS$
* <cSortedString> the string resulting from the sort process
* $DESCRIPTION$
* The CHARSORT function sorts the characters within a string <cString>.
* With the parameters <nIgnoreCharacters> and <nSortLength>, you can
* determine that only the substring from position <nIgnoreCharacters>+1
* to position <nIgnoreCharacters>+<nSortLength> within <cString> should
* be sorted.
* The sorting algorithm is determined with the other parameters.
* <nElementLength> specifies the length of one element, i.e. there are
* <nSortLength>/<nElementLength> elements that are sorted. Note that
* surplus characters are not sorted but stay at their position.
* To do the sorting, the function uses the Quicksort algorithm implemented
* in the C-lib qsort() function. This algorithm needs to know how to compare
* and order two elements. This is done by comparing the ASCII values of
* a substring within each element. This substring is determined by the
* parameters <nElementOffset> and <nCompareLength> and the order
* by <lDescending>.
* By setting the CSETREF() switch to .T., one can omit the return value
* of the function, but one must then pass <cString> by reference.
* $EXAMPLES$
* ? CHARSORT( "qwert" ) // "eqrtw"
* ? CHARSORT( "qwert", 2 ) // "erqwt"
* ? CHARSORT( "b1a4a3a2a1", 2, 1 ) // "a2a1a3a4b1"
* ? CHARSORT( "XXXqwert", 1, 1, 3 ) // "XXXeqrtw"
* ? CHARSORT( "b1a4a3a2a1", 2, 1, 0, 1 ) // "a1b1a2a3a4"
* ? CHARSORT( "384172852", 1, 1, 0, 0, 4 ) // "134872852"
* ? CHARSORT( "qwert", .T. ) // "wtrqe"
* $TESTS$
* CHARSORT( "qwert" ) == "eqrtw"
* CHARSORT( "qwert", 2 ) == "erqwt"
* CHARSORT( "b1a4a3a2a1", 2, 1 ) == "a2a1a3a4b1"
* CHARSORT( "XXXqwert", 1, 1, 3 ) == "XXXeqrtw"
* CHARSORT( "b1a4a3a2a1", 2, 1, 0, 1 ) == "a1b1a2a3a4"
* CHARSORT( "384172852", 1, 1, 0, 0, 4 ) == "134872852"
* CHARSORT( "qwert", .T. ) == "wtrqe"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARSORT() is compatible with CT3's CHARSORT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARSORT()
$CATEGORY$
CT3 string functions
$ONELINER$
Sort sequences within a string.
$SYNTAX$
CHARSORT( <[@]cString>, [<nElementLength>], [<nCompareLength>],
[<nIgnoreCharacters>], [<nElemenOffset>], [<nSortLength>],
[<lDescending>] ) -> cSortedString
$ARGUMENTS$
<[@]cString> is the string that should be processed
[<nElementLength>] specifies the length of the elements that
should be sorted
Default: 1
[<nCompareLength>] specifies how many characters within one
element should be used for comparison
Default: <nElementLength>
[<nIgnoreCharacters>] specifies the number of characters at the
beginning of <cString> that should be ignored
in the sort process
Default: 0
[<nElementOffset>] specifies the offset of the comparison string
within a element
Default: 0
[<nSortLength>] specifies how many characters in <cString>,
starting from the <nIgnoreCharacters> position,
should be sorted
Default: len(cString)-nIgnoreCharacters
[<lDescending>]) specifies whether the process should
sort descending or not
$RETURNS$
<cSortedString> the string resulting from the sort process
$DESCRIPTION$
The CHARSORT function sorts the characters within a string <cString>.
With the parameters <nIgnoreCharacters> and <nSortLength>, you can
determine that only the substring from position <nIgnoreCharacters>+1
to position <nIgnoreCharacters>+<nSortLength> within <cString> should
be sorted.
The sorting algorithm is determined with the other parameters.
<nElementLength> specifies the length of one element, i.e. there are
<nSortLength>/<nElementLength> elements that are sorted. Note that
surplus characters are not sorted but stay at their position.
To do the sorting, the function uses the Quicksort algorithm implemented
in the C-lib qsort() function. This algorithm needs to know how to compare
and order two elements. This is done by comparing the ASCII values of
a substring within each element. This substring is determined by the
parameters <nElementOffset> and <nCompareLength> and the order
by <lDescending>.
By setting the CSETREF() switch to .T., one can omit the return value
of the function, but one must then pass <cString> by reference.
$EXAMPLES$
? CHARSORT( "qwert" ) // "eqrtw"
? CHARSORT( "qwert", 2 ) // "erqwt"
? CHARSORT( "b1a4a3a2a1", 2, 1 ) // "a2a1a3a4b1"
? CHARSORT( "XXXqwert", 1, 1, 3 ) // "XXXeqrtw"
? CHARSORT( "b1a4a3a2a1", 2, 1, 0, 1 ) // "a1b1a2a3a4"
? CHARSORT( "384172852", 1, 1, 0, 0, 4 ) // "134872852"
? CHARSORT( "qwert", .T. ) // "wtrqe"
$TESTS$
CHARSORT( "qwert" ) == "eqrtw"
CHARSORT( "qwert", 2 ) == "erqwt"
CHARSORT( "b1a4a3a2a1", 2, 1 ) == "a2a1a3a4b1"
CHARSORT( "XXXqwert", 1, 1, 3 ) == "XXXeqrtw"
CHARSORT( "b1a4a3a2a1", 2, 1, 0, 1 ) == "a1b1a2a3a4"
CHARSORT( "384172852", 1, 1, 0, 0, 4 ) == "134872852"
CHARSORT( "qwert", .T. ) == "wtrqe"
$STATUS$
Ready
$COMPLIANCE$
CHARSORT() is compatible with CT3's CHARSORT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CSETREF()
$END$
*/

View File

@@ -2,84 +2,84 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARSWAP()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Swap neighbouring characters in a string
* $SYNTAX$
* CHARSWAP( <[@]cString> ) -> cSwappedString
* $ARGUMENTS$
* <[@]cString> is the string that should be processed
* $RETURNS$
* <cSwappedString> a string where neighbour characters are swapped
* $DESCRIPTION$
* The CHARSWAP() function loops through <cString> in steps of two
* characters and exchanges the characters from the odd and the even
* positions.
* By setting the CSETREF() switch to .T., one can omit the return value
* of this functin, but one must then pass <cString> by reference.
* $EXAMPLES$
* ? CHARSWAP( "0123456789" ) // "1032547698"
* ? CHARSWAP( "ABCDEFGHIJK" ) // "BADCFEHGJIK"
* $TESTS$
* CHARSWAP( "0123456789" ) == "1032547698"
* CHARSWAP( "ABCDEFGHIJK" ) == "BADCFEHGJIK"
* $STATUS$
* Ready
* $COMPLIANCE$
* CHARSWAP() is compatible with CT3's CHARSWAP().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* WORDSWAP(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARSWAP()
$CATEGORY$
CT3 string functions
$ONELINER$
Swap neighbouring characters in a string
$SYNTAX$
CHARSWAP( <[@]cString> ) -> cSwappedString
$ARGUMENTS$
<[@]cString> is the string that should be processed
$RETURNS$
<cSwappedString> a string where neighbour characters are swapped
$DESCRIPTION$
The CHARSWAP() function loops through <cString> in steps of two
characters and exchanges the characters from the odd and the even
positions.
By setting the CSETREF() switch to .T., one can omit the return value
of this functin, but one must then pass <cString> by reference.
$EXAMPLES$
? CHARSWAP( "0123456789" ) // "1032547698"
? CHARSWAP( "ABCDEFGHIJK" ) // "BADCFEHGJIK"
$TESTS$
CHARSWAP( "0123456789" ) == "1032547698"
CHARSWAP( "ABCDEFGHIJK" ) == "BADCFEHGJIK"
$STATUS$
Ready
$COMPLIANCE$
CHARSWAP() is compatible with CT3's CHARSWAP().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
WORDSWAP(),CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* WORDSWAP()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Swap neighbouring double characters in a string
* $SYNTAX$
* WORDSWAP( <[@]cString> [, <lSwapCharacters>] ) -> cSwappedString
* $ARGUMENTS$
* <[@]cString> is the string that should be processed
* [<lSwapCharacters>] specifies whether an additional swap should be
* done within the double characters
* Default: .F., no additional swap
* $RETURNS$
* <cSwappedString> a string where neighbouring double characters are
* swapped
* $DESCRIPTION$
* The WORDSWAP() function loops through <cString> in steps of four
* characters and exchanges the double characters from the first and
* second position with the one from the third and forth position.
* Additionally the function can perform a swap of the both char of
* each double character.
* By setting the CSETREF() switch to .T., one can omit the return value
* of this functin, but one must then pass <cString> by reference.
* $EXAMPLES$
* ? WORDSWAP( "1234567890" ) // "3412785690"
* ? WORDSWAP( "1234567890", .T. ) // "4321876590"
* $TESTS$
* WORDSWAP( "1234567890" ) == "3412785690"
* WORDSWAP( "1234567890", .T. ) == "4321876590"
* $STATUS$
* Ready
* $COMPLIANCE$
* WORDSWAP() is compatible with CT3's WORDSWAP().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARSWAP(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
WORDSWAP()
$CATEGORY$
CT3 string functions
$ONELINER$
Swap neighbouring double characters in a string
$SYNTAX$
WORDSWAP( <[@]cString> [, <lSwapCharacters>] ) -> cSwappedString
$ARGUMENTS$
<[@]cString> is the string that should be processed
[<lSwapCharacters>] specifies whether an additional swap should be
done within the double characters
Default: .F., no additional swap
$RETURNS$
<cSwappedString> a string where neighbouring double characters are
swapped
$DESCRIPTION$
The WORDSWAP() function loops through <cString> in steps of four
characters and exchanges the double characters from the first and
second position with the one from the third and forth position.
Additionally the function can perform a swap of the both char of
each double character.
By setting the CSETREF() switch to .T., one can omit the return value
of this functin, but one must then pass <cString> by reference.
$EXAMPLES$
? WORDSWAP( "1234567890" ) // "3412785690"
? WORDSWAP( "1234567890", .T. ) // "4321876590"
$TESTS$
WORDSWAP( "1234567890" ) == "3412785690"
WORDSWAP( "1234567890", .T. ) == "4321876590"
$STATUS$
Ready
$COMPLIANCE$
WORDSWAP() is compatible with CT3's WORDSWAP().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARSWAP(),CSETREF()
$END$
*/

View File

@@ -2,218 +2,218 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* INVERTATTR()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
*
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* INVERTATTR() is compatible with CT3's INVERTATTR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
INVERTATTR()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
INVERTATTR() is compatible with CT3's INVERTATTR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* COLORTON()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* COLORTON( <cAttr> ) -> <nAttr>
* $ARGUMENTS$
* <cAttr> Designates the alphanumeric color attribute that is
* converted in NN/NN or CC/CC form.
*
* $RETURNS$
* COLORTON() returns a number that corresponds to the combined numeric
* color attribute.
*
* $DESCRIPTION$
* COLOR TO (N)umeric
* The function changes an alphanumeric color attribute from NN/NN or
* CC/CC into a combined numeric attribute. These combined attribute
* values are useful with the CA-Cl*pper Tools functions STRSCREEN(),
* SCREENMIX(), SCREENATTR(), and the CA-Cl*pper commands
* SAVE/RESTORE SCREEN.
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
COLORTON()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
COLORTON( <cAttr> ) -> <nAttr>
$ARGUMENTS$
<cAttr> Designates the alphanumeric color attribute that is
converted in NN/NN or CC/CC form.
$RETURNS$
COLORTON() returns a number that corresponds to the combined numeric
color attribute.
$DESCRIPTION$
COLOR TO (N)umeric
The function changes an alphanumeric color attribute from NN/NN or
CC/CC into a combined numeric attribute. These combined attribute
values are useful with the CA-Cl*pper Tools functions STRSCREEN(),
SCREENMIX(), SCREENATTR(), and the CA-Cl*pper commands
SAVE/RESTORE SCREEN.
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* NTOCOLOR()
* $CATEGORY$
* HBCT video functions
* $ONELINER$
*
* $SYNTAX$
* NTOCOLOR( <nAttr>, [<lColorCode>] ) -> <cAttr>
* $ARGUMENTS$
* <nAttr> Designates the value for the combined numeric color
* attributes.
*
* <lColorCode> If designated as .F. or if the parameter is omitted,
* NTOCOLOR() returns a string with a numeric color code.
* When designated as .T., NTOCOLOR() returns a string with
* the CA-Cl*pper alpha color coding.
*
* $RETURNS$
* NTOCOLOR() returns the designated color attribute in the NN/NN
* or CC/CC form.
*
* $DESCRIPTION$
* NTOCOLOR() converts a color attribute returned from another function
* in numeric form, into the alphanumeric data format. Use this
* attribute in conjunction with the CA-Cl*pper SET COLOR TO command.
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
NTOCOLOR()
$CATEGORY$
HBCT video functions
$ONELINER$
$SYNTAX$
NTOCOLOR( <nAttr>, [<lColorCode>] ) -> <cAttr>
$ARGUMENTS$
<nAttr> Designates the value for the combined numeric color
attributes.
<lColorCode> If designated as .F. or if the parameter is omitted,
NTOCOLOR() returns a string with a numeric color code.
When designated as .T., NTOCOLOR() returns a string with
the CA-Cl*pper alpha color coding.
$RETURNS$
NTOCOLOR() returns the designated color attribute in the NN/NN
or CC/CC form.
$DESCRIPTION$
NTOCOLOR() converts a color attribute returned from another function
in numeric form, into the alphanumeric data format. Use this
attribute in conjunction with the CA-Cl*pper SET COLOR TO command.
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* ENHANCED()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
* Select the "ENHANCED" color value for output
* $SYNTAX$
* ENHANCED() -> <cEmptyString>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* ENHANCED() is compatible with CT3's ENHANCED()
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* STANDARD(),UNSELECTED()
* $END$
/* $DOC$
$FUNCNAME$
ENHANCED()
$CATEGORY$
CT3 video functions
$ONELINER$
Select the "ENHANCED" color value for output
$SYNTAX$
ENHANCED() -> <cEmptyString>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
ENHANCED() is compatible with CT3's ENHANCED()
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
STANDARD(),UNSELECTED()
$END$
*/
/* $DOC$
* $FUNCNAME$
* STANDARD()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
* Select the "STANDARD" color value for output
* $SYNTAX$
* STANDARD() -> <cEmptyString>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* STANDARD() is compatible with CT3's STANDARD()
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ENHANCED(),UNSELECTED()
* $END$
/* $DOC$
$FUNCNAME$
STANDARD()
$CATEGORY$
CT3 video functions
$ONELINER$
Select the "STANDARD" color value for output
$SYNTAX$
STANDARD() -> <cEmptyString>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
STANDARD() is compatible with CT3's STANDARD()
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ENHANCED(),UNSELECTED()
$END$
*/
/* $DOC$
* $FUNCNAME$
* UNSELECTED()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
* Select the "UNSELECTED" color value for output
* $SYNTAX$
* UNSELECTED() -> <cEmptyString>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* UNSELECTED() is compatible with CT3's UNSELECTED()
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ENHANCED(),STANDARD()
* $END$
/* $DOC$
$FUNCNAME$
UNSELECTED()
$CATEGORY$
CT3 video functions
$ONELINER$
Select the "UNSELECTED" color value for output
$SYNTAX$
UNSELECTED() -> <cEmptyString>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
UNSELECTED() is compatible with CT3's UNSELECTED()
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ENHANCED(),STANDARD()
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* COUNTLEFT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Count a certain character at the beginning of a string
* $SYNTAX$
* COUNTLEFT( <cString>, [<cSearch|nSearch>] ) -> nCount
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* COUNTLEFT() is compatible with CT3's COUNTLEFT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* COUNTRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
COUNTLEFT()
$CATEGORY$
CT3 string functions
$ONELINER$
Count a certain character at the beginning of a string
$SYNTAX$
COUNTLEFT( <cString>, [<cSearch|nSearch>] ) -> nCount
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
COUNTLEFT() is compatible with CT3's COUNTLEFT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
COUNTRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* COUNTRIGHT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Count a certain character at the end of a string
* $SYNTAX$
* COUNTRIGHT( <cString>, [<cSearch|nSearch>] ) -> nCount
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* COUNTRIGHT() is compatible with CT3's COUNTRIGHT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* COUNTLEFT()
* $END$
/* $DOC$
$FUNCNAME$
COUNTRIGHT()
$CATEGORY$
CT3 string functions
$ONELINER$
Count a certain character at the end of a string
$SYNTAX$
COUNTRIGHT( <cString>, [<cSearch|nSearch>] ) -> nCount
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
COUNTRIGHT() is compatible with CT3's COUNTRIGHT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
COUNTLEFT()
$END$
*/

View File

@@ -2,74 +2,74 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CTINIT()
* $CATEGORY$
* CT3 general functions
* $ONELINER$
* Initializes the CT3 library
* $SYNTAX$
* CTINIT() -> lInitialized
* $ARGUMENTS$
* None
* $RETURNS$
* lInitialized .T. if the function has been correctly initialized
* $DESCRIPTION$
* The CTINIT() function initializes the CT3 library.
* Identical code is declared as INIT FUNCTION, thus should be executed
* automatically at the beginning of the application, but it is a good
* idea to call it once again explicitly somewhere at the beginning of
* your program to check the initialization.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* CTINIT() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
CTINIT()
$CATEGORY$
CT3 general functions
$ONELINER$
Initializes the CT3 library
$SYNTAX$
CTINIT() -> lInitialized
$ARGUMENTS$
None
$RETURNS$
lInitialized .T. if the function has been correctly initialized
$DESCRIPTION$
The CTINIT() function initializes the CT3 library.
Identical code is declared as INIT FUNCTION, thus should be executed
automatically at the beginning of the application, but it is a good
idea to call it once again explicitly somewhere at the beginning of
your program to check the initialization.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
CTINIT() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTEXIT()
* $CATEGORY$
* CT3 general functions
* $ONELINER$
* Uninitializes the CT3 library
* $SYNTAX$
* CTEXIT() -> nil
* $ARGUMENTS$
* none
* $RETURNS$
* nil
* $DESCRIPTION$
* The CTEXIT() function uninitializes the CT3 library.
* Identical code is declared as EXIT FUNCTION, thus should be executed
* automatically at the end of the application, but it is a good idea
* to call it explicitly somewhere at the end of your program to make
* sure that the deinitialization takes place.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* CTEXIT() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
CTEXIT()
$CATEGORY$
CT3 general functions
$ONELINER$
Uninitializes the CT3 library
$SYNTAX$
CTEXIT() -> nil
$ARGUMENTS$
none
$RETURNS$
nil
$DESCRIPTION$
The CTEXIT() function uninitializes the CT3 library.
Identical code is declared as EXIT FUNCTION, thus should be executed
automatically at the end of the application, but it is a good idea
to call it explicitly somewhere at the end of your program to make
sure that the deinitialization takes place.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
CTEXIT() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,111 +2,111 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CSETARGERR()
* $CATEGORY$
* CT3 general functions
* $ONELINER$
* Sets argument error behaviour
* $SYNTAX$
* CSETARGERR( [<nNewMode>] ) -> <nOldMode>
* $ARGUMENTS$
* [<nNewMode>] New argument error throwing mode
* $RETURNS$
* <nOldMode> The current or old argument error throwing mode.
* $DESCRIPTION$
* All CT3 functions are very compliant in their reaction to wrong
* parameters. By using the CSETARGERR() function, you can make the
* library throw an error with the severity <nNewMode>. It is then
* up to the error handler to substitute the return value.
* <nNewMode> can be one of the severity modes defined in ct.ch:
* CT_ARGERR_WHOCARES corresponds to ES_WHOCARES
* CT_ARGERR_WARNING corresponds to ES_WARNING
* CT_ARGERR_ERROR corresponds to ES_ERROR
* CT_ARGERR_CATASTROPHIC corresponds to ES_CATASTROPHIC
* CT_ARGERR_IGNORE
* The last is the default behaviour and switches any argument error
* throwing off.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* CSETARGERR() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
CSETARGERR()
$CATEGORY$
CT3 general functions
$ONELINER$
Sets argument error behaviour
$SYNTAX$
CSETARGERR( [<nNewMode>] ) -> <nOldMode>
$ARGUMENTS$
[<nNewMode>] New argument error throwing mode
$RETURNS$
<nOldMode> The current or old argument error throwing mode.
$DESCRIPTION$
All CT3 functions are very compliant in their reaction to wrong
parameters. By using the CSETARGERR() function, you can make the
library throw an error with the severity <nNewMode>. It is then
up to the error handler to substitute the return value.
<nNewMode> can be one of the severity modes defined in ct.ch:
CT_ARGERR_WHOCARES corresponds to ES_WHOCARES
CT_ARGERR_WARNING corresponds to ES_WARNING
CT_ARGERR_ERROR corresponds to ES_ERROR
CT_ARGERR_CATASTROPHIC corresponds to ES_CATASTROPHIC
CT_ARGERR_IGNORE
The last is the default behaviour and switches any argument error
throwing off.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
CSETARGERR() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTCINIT()
* $CATEGORY$
* CT3 general functions
* $ONELINER$
* Initializes the CT3 library, C part
* $SYNTAX$
* CTCINIT() -> lInitialized
* $ARGUMENTS$
* None
* $RETURNS$
* lInitialized .T. if the function has been correctly initialized
* $DESCRIPTION$
* The CTCINIT() function initializes the C source part of the CT3
* library. Do not call this function directly.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* CTCINIT() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTINIT(),CTEXIT()
* $END$
/* $DOC$
$FUNCNAME$
CTCINIT()
$CATEGORY$
CT3 general functions
$ONELINER$
Initializes the CT3 library, C part
$SYNTAX$
CTCINIT() -> lInitialized
$ARGUMENTS$
None
$RETURNS$
lInitialized .T. if the function has been correctly initialized
$DESCRIPTION$
The CTCINIT() function initializes the C source part of the CT3
library. Do not call this function directly.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
CTCINIT() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTINIT(),CTEXIT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTCEXIT()
* $CATEGORY$
* CT3 general functions
* $ONELINER$
* Uninitializes the CT3 library, C part
* $SYNTAX$
* CTCEXIT() -> NIL
* $ARGUMENTS$
* none
* $RETURNS$
* nil
* $DESCRIPTION$
* The CTCEXIT() function uninitializes the C part of the CT3 library.
* Do not call this function directly.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* CTCEXIT() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTINIT(),CTEXIT()
* $END$
/* $DOC$
$FUNCNAME$
CTCEXIT()
$CATEGORY$
CT3 general functions
$ONELINER$
Uninitializes the CT3 library, C part
$SYNTAX$
CTCEXIT() -> NIL
$ARGUMENTS$
none
$RETURNS$
nil
$DESCRIPTION$
The CTCEXIT() function uninitializes the C part of the CT3 library.
Do not call this function directly.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
CTCEXIT() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTINIT(),CTEXIT()
$END$
*/

View File

@@ -2,68 +2,68 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* SETPREC()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Set precision of math functions
* $SYNTAX$
* SETPREC( <nPrecision> ) -> cEmptyString
* $ARGUMENTS$
* <nPrecision> digit count between 1 and 16, defaults to 16
* $RETURNS$
* cEmptyString this function always returns an empty string
* $DESCRIPTION$
* Be aware that calls to this functions do _NOT_ affect the
* calculation precision of the math functions at the moment.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* SETPREC() is compatible with CT3's SETPREC.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SETPREC()
$CATEGORY$
CT3 math functions
$ONELINER$
Set precision of math functions
$SYNTAX$
SETPREC( <nPrecision> ) -> cEmptyString
$ARGUMENTS$
<nPrecision> digit count between 1 and 16, defaults to 16
$RETURNS$
cEmptyString this function always returns an empty string
$DESCRIPTION$
Be aware that calls to this functions do _NOT_ affect the
calculation precision of the math functions at the moment.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
SETPREC() is compatible with CT3's SETPREC.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* GETPREC()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Get precision of math functions
* $SYNTAX$
* GETPREC() -> nDigits
* $ARGUMENTS$
*
* $RETURNS$
* nDigits digit count between 1 and 16
* $DESCRIPTION$
* Be aware that calls to this functions do _NOT_ affect the
* calculation precision of the math functions at the moment.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* GETPREC() is compatible with CT3's GETPREC.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
GETPREC()
$CATEGORY$
CT3 math functions
$ONELINER$
Get precision of math functions
$SYNTAX$
GETPREC() -> nDigits
$ARGUMENTS$
$RETURNS$
nDigits digit count between 1 and 16
$DESCRIPTION$
Be aware that calls to this functions do _NOT_ affect the
calculation precision of the math functions at the moment.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
GETPREC() is compatible with CT3's GETPREC.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,185 +2,185 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FLOOR()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Rounds down a number to the next integer
* $SYNTAX$
* FLOOR( <nNumber> ) -> nDownRoundedNumber
* $ARGUMENTS$
* <nNumber> number to round down
* $RETURNS$
* <nDownRoundedNumber> the rounded number
* $DESCRIPTION$
* The function FLOOR() determines the biggest integer that is smaller
* than <nNumber>.
* $EXAMPLES$
* ? floor( 1.1 ) // --> 1.0
* ? floor( -1.1 ) // --> -2.0
* $TESTS$
* floor( 1.1 ) == 1.0
* floor( -1.1 ) == -2.0
* $STATUS$
* Ready
* $COMPLIANCE$
* FLOOR() is compatible with CT3's FLOOR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CEILING
* $END$
/* $DOC$
$FUNCNAME$
FLOOR()
$CATEGORY$
CT3 math functions
$ONELINER$
Rounds down a number to the next integer
$SYNTAX$
FLOOR( <nNumber> ) -> nDownRoundedNumber
$ARGUMENTS$
<nNumber> number to round down
$RETURNS$
<nDownRoundedNumber> the rounded number
$DESCRIPTION$
The function FLOOR() determines the biggest integer that is smaller
than <nNumber>.
$EXAMPLES$
? floor( 1.1 ) // --> 1.0
? floor( -1.1 ) // --> -2.0
$TESTS$
floor( 1.1 ) == 1.0
floor( -1.1 ) == -2.0
$STATUS$
Ready
$COMPLIANCE$
FLOOR() is compatible with CT3's FLOOR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CEILING
$END$
*/
/* $DOC$
* $FUNCNAME$
* CEILING()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Rounds up a number to the next integer
* $SYNTAX$
* CEILING( <nNumber> ) -> nUpRoundedNumber
* $ARGUMENTS$
* <nNumber> number to round up
* $RETURNS$
* <nUpRoundedNumber> the rounded number
* $DESCRIPTION$
* The function CEILING() determines the smallest integer that is bigger
* than <nNumber>.
* $EXAMPLES$
* ? ceiling( 1.1 ) // --> 2.0
* ? ceiling( -1.1 ) // --> -1.0
* $TESTS$
* ceiling( 1.1 ) == 2.0
* ceiling( -1.1 ) == -1.0
* $STATUS$
* Ready
* $COMPLIANCE$
* CEILING() is compatible with CT3's CEILING().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* FLOOR
* $END$
/* $DOC$
$FUNCNAME$
CEILING()
$CATEGORY$
CT3 math functions
$ONELINER$
Rounds up a number to the next integer
$SYNTAX$
CEILING( <nNumber> ) -> nUpRoundedNumber
$ARGUMENTS$
<nNumber> number to round up
$RETURNS$
<nUpRoundedNumber> the rounded number
$DESCRIPTION$
The function CEILING() determines the smallest integer that is bigger
than <nNumber>.
$EXAMPLES$
? ceiling( 1.1 ) // --> 2.0
? ceiling( -1.1 ) // --> -1.0
$TESTS$
ceiling( 1.1 ) == 2.0
ceiling( -1.1 ) == -1.0
$STATUS$
Ready
$COMPLIANCE$
CEILING() is compatible with CT3's CEILING().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
FLOOR
$END$
*/
/* $DOC$
* $FUNCNAME$
* SIGN()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Sign of a number
* $SYNTAX$
* SIGN( <nNumber> ) -> nSign
* $ARGUMENTS$
* <nNumber> a number
* $RETURNS$
* <nSign> sign of <nNumber>
* $DESCRIPTION$
* The function SIGN() determines the sign of <nNumber>.
* If <nNumber> is > 0, then SIGN(<nNumber>) returns 1
* If <nNumber> is < 0, then SIGN(<nNumber>) returns -1
* If <nNumber> is == 0, then SIGN(<nNumber>) returns 0
* $EXAMPLES$
* ? sign( 1.1 ) // --> 1
* ? sign( -1.1 ) // --> -1
* ? sign( 0.0 ) // --> 0
* $TESTS$
* sign( 1.1 ) == 1
* sign( -1.1 ) == -1
* sign( 0.0 ) == 0
* $STATUS$
* Ready
* $COMPLIANCE$
* SIGN() is compatible with CT3's SIGN().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SIGN()
$CATEGORY$
CT3 math functions
$ONELINER$
Sign of a number
$SYNTAX$
SIGN( <nNumber> ) -> nSign
$ARGUMENTS$
<nNumber> a number
$RETURNS$
<nSign> sign of <nNumber>
$DESCRIPTION$
The function SIGN() determines the sign of <nNumber>.
If <nNumber> is > 0, then SIGN(<nNumber>) returns 1
If <nNumber> is < 0, then SIGN(<nNumber>) returns -1
If <nNumber> is == 0, then SIGN(<nNumber>) returns 0
$EXAMPLES$
? sign( 1.1 ) // --> 1
? sign( -1.1 ) // --> -1
? sign( 0.0 ) // --> 0
$TESTS$
sign( 1.1 ) == 1
sign( -1.1 ) == -1
sign( 0.0 ) == 0
$STATUS$
Ready
$COMPLIANCE$
SIGN() is compatible with CT3's SIGN().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* LOG10()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Decadic logarithm of a number
* $SYNTAX$
* LOG10( <nNumber> ) -> nLogarithm
* $ARGUMENTS$
* <nNumber> number to logarithm
* $RETURNS$
* <nLogarithm> decadic logarithm of <nNumber>
* $DESCRIPTION$
* The function LOG10() calculates the decadic logarithm of <nNumber>,
* i.e. 10^<nLogarithm> == <nNumber>.
* $EXAMPLES$
* ? log10( 10.0 ) // --> 1.0
* ? log10( sqrt( 10.0 ) ) // --> 0.5
* $TESTS$
* log10( 10.0 ) == 1.0
* log10( sqrt( 10.0 ) ) == 0.5
* $STATUS$
* Ready
* $COMPLIANCE$
* LOG10() is compatible with CT3's LOG10().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
LOG10()
$CATEGORY$
CT3 math functions
$ONELINER$
Decadic logarithm of a number
$SYNTAX$
LOG10( <nNumber> ) -> nLogarithm
$ARGUMENTS$
<nNumber> number to logarithm
$RETURNS$
<nLogarithm> decadic logarithm of <nNumber>
$DESCRIPTION$
The function LOG10() calculates the decadic logarithm of <nNumber>,
i.e. 10^<nLogarithm> == <nNumber>.
$EXAMPLES$
? log10( 10.0 ) // --> 1.0
? log10( sqrt( 10.0 ) ) // --> 0.5
$TESTS$
log10( 10.0 ) == 1.0
log10( sqrt( 10.0 ) ) == 0.5
$STATUS$
Ready
$COMPLIANCE$
LOG10() is compatible with CT3's LOG10().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* FACT()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Calculates faculty
* $SYNTAX$
* FACT( <nNumber> ) -> nFaculty
* $ARGUMENTS$
* <nNumber> number between 0 and 21
* $RETURNS$
* <nFaculty> the faculty of <nNumber>
* $DESCRIPTION$
* The function FACT() calculates the faculty to the integer given in
* <nNumber>. The faculty is defined as n! = 1*2*...*n and is often
* used in statistics. Note, that faculties above 21 are too big
* so that the function must return a -1.
* $EXAMPLES$
* ? fact( 0 ) // --> 1
* ? fact( 1 ) // --> 1
* ? fact( 4 ) // --> 24
* $TESTS$
* fact( 0 ) == 1
* fact( 1 ) == 1
* fact( 4 ) == 24
* $STATUS$
* Ready
* $COMPLIANCE$
* FACT() is compatible with CT3's FACT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
FACT()
$CATEGORY$
CT3 math functions
$ONELINER$
Calculates faculty
$SYNTAX$
FACT( <nNumber> ) -> nFaculty
$ARGUMENTS$
<nNumber> number between 0 and 21
$RETURNS$
<nFaculty> the faculty of <nNumber>
$DESCRIPTION$
The function FACT() calculates the faculty to the integer given in
<nNumber>. The faculty is defined as n! = 1*2*...*n and is often
used in statistics. Note, that faculties above 21 are too big
so that the function must return a -1.
$EXAMPLES$
? fact( 0 ) // --> 1
? fact( 1 ) // --> 1
? fact( 4 ) // --> 24
$TESTS$
fact( 0 ) == 1
fact( 1 ) == 1
fact( 4 ) == 24
$STATUS$
Ready
$COMPLIANCE$
FACT() is compatible with CT3's FACT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* PADLEFT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Fills string to a certain length on the left
* $SYNTAX$
* PADLEFT( <cString>, <nLength>, [<cChar|nChar>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* PADLEFT() is compatible with CT3's PADLEFT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* PADRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
PADLEFT()
$CATEGORY$
CT3 string functions
$ONELINER$
Fills string to a certain length on the left
$SYNTAX$
PADLEFT( <cString>, <nLength>, [<cChar|nChar>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
PADLEFT() is compatible with CT3's PADLEFT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
PADRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* PADRIGHT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Fills string to a certain length on the right
* $SYNTAX$
* PADRIGHT( <cString>, <nLength>, [<cChar|nChar>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* PADRIGHT() is compatible with CT3's PADRIGHT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* PADLEFT()
* $END$
/* $DOC$
$FUNCNAME$
PADRIGHT()
$CATEGORY$
CT3 string functions
$ONELINER$
Fills string to a certain length on the right
$SYNTAX$
PADRIGHT( <cString>, <nLength>, [<cChar|nChar>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
PADRIGHT() is compatible with CT3's PADRIGHT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
PADLEFT()
$END$
*/

View File

@@ -2,170 +2,170 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CSETREF()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Determine return value of reference sensitive CT3 string functions
* $SYNTAX$
* CSETREF( [<lNewSwitch>] ) -> lOldSwitch
* $ARGUMENTS$
* [<lNewSwitch>] .T. -> suppress return value
* .F. -> do not suppress return value
* $RETURNS$
* lOldSwitch old (if lNewSwitch is a logical value) or
* current state of the switch
* $DESCRIPTION$
* Within the CT3 functions, the following functions do not
* change the length of a string passed as parameter while
* transforming this string:
*
* ADDASCII() BLANK() CHARADD()
* CHARAND() CHARMIRR() CHARNOT()
* CHAROR() CHARRELREP() CHARREPL()
* CHARSORT() CHARSWAP() CHARXOR()
* CRYPT() JUSTLEFT() JUSTRIGHT()
* POSCHAR() POSREPL() RANGEREPL()
* REPLALL() REPLLEFT() REPLRIGHT()
* TOKENLOWER() TOKENUPPER() WORDREPL()
* WORDSWAP()
*
* Thus, these functions allow to pass the string by reference [@] to
* the function so that it may not be necessary to return the transformed
* string. By calling CSETREF (.T.), the above mentioned functions return
* the value .F. instead of the transformed string if the string is
* passed by reference to the function.
* The switch is turned off (.F.) by default.
*
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* This function is fully CT3 compatible.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ADDASCII() BLANK() CHARADD()
* CHARAND() CHARMIRR() CHARNOT()
* CHAROR() CHARRELREP() CHARREPL()
* CHARSORT() CHARSWAP() CHARXOR()
* CRYPT() JUSTLEFT() JUSTRIGHT()
* POSCHAR() POSREPL() RANGEREPL()
* REPLALL() REPLLEFT() REPLRIGHT()
* TOKENLOWER() TOKENUPPER() WORDREPL()
* WORDSWAP()
* $END$
/* $DOC$
$FUNCNAME$
CSETREF()
$CATEGORY$
CT3 string functions
$ONELINER$
Determine return value of reference sensitive CT3 string functions
$SYNTAX$
CSETREF( [<lNewSwitch>] ) -> lOldSwitch
$ARGUMENTS$
[<lNewSwitch>] .T. -> suppress return value
.F. -> do not suppress return value
$RETURNS$
lOldSwitch old (if lNewSwitch is a logical value) or
current state of the switch
$DESCRIPTION$
Within the CT3 functions, the following functions do not
change the length of a string passed as parameter while
transforming this string:
ADDASCII() BLANK() CHARADD()
CHARAND() CHARMIRR() CHARNOT()
CHAROR() CHARRELREP() CHARREPL()
CHARSORT() CHARSWAP() CHARXOR()
CRYPT() JUSTLEFT() JUSTRIGHT()
POSCHAR() POSREPL() RANGEREPL()
REPLALL() REPLLEFT() REPLRIGHT()
TOKENLOWER() TOKENUPPER() WORDREPL()
WORDSWAP()
Thus, these functions allow to pass the string by reference [@] to
the function so that it may not be necessary to return the transformed
string. By calling CSETREF (.T.), the above mentioned functions return
the value .F. instead of the transformed string if the string is
passed by reference to the function.
The switch is turned off (.F.) by default.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
This function is fully CT3 compatible.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ADDASCII() BLANK() CHARADD()
CHARAND() CHARMIRR() CHARNOT()
CHAROR() CHARRELREP() CHARREPL()
CHARSORT() CHARSWAP() CHARXOR()
CRYPT() JUSTLEFT() JUSTRIGHT()
POSCHAR() POSREPL() RANGEREPL()
REPLALL() REPLLEFT() REPLRIGHT()
TOKENLOWER() TOKENUPPER() WORDREPL()
WORDSWAP()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CSETATMUPA()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Determine "multi-pass" behaviour in some string functions
* $SYNTAX$
* CSETATMUPA( [<lNewSwitch>] ) -> lOldSwitch
* $ARGUMENTS$
* [<lNewSwitch>] .T. -> turn "multi-pass" on
* .F. -> turn "multi-pass" off
* $RETURNS$
* lOldSwitch old (if lNewSwitch is a logical value) or
* current state of the switch
* $DESCRIPTION$
* CSETATMUPA determines how the following CT3 string functions
*
* ATNUM() AFTERATNUM() BEFORATNUM()
* ATREPL() NUMAT() ATADJUST()
* WORDTOCHAR() WORDREPL()
*
* perform their work. See the respective function documentation for a
* further description how the switch influences these functions.
*
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* This function is fully CT3 compatible.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* ATNUM() AFTERATNUM() BEFORATNUM()
* ATREPL() NUMAT() ATADJUST()
* WORDTOCHAR() WORDREPL()
* $END$
/* $DOC$
$FUNCNAME$
CSETATMUPA()
$CATEGORY$
CT3 string functions
$ONELINER$
Determine "multi-pass" behaviour in some string functions
$SYNTAX$
CSETATMUPA( [<lNewSwitch>] ) -> lOldSwitch
$ARGUMENTS$
[<lNewSwitch>] .T. -> turn "multi-pass" on
.F. -> turn "multi-pass" off
$RETURNS$
lOldSwitch old (if lNewSwitch is a logical value) or
current state of the switch
$DESCRIPTION$
CSETATMUPA determines how the following CT3 string functions
ATNUM() AFTERATNUM() BEFORATNUM()
ATREPL() NUMAT() ATADJUST()
WORDTOCHAR() WORDREPL()
perform their work. See the respective function documentation for a
further description how the switch influences these functions.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
This function is fully CT3 compatible.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
ATNUM() AFTERATNUM() BEFORATNUM()
ATREPL() NUMAT() ATADJUST()
WORDTOCHAR() WORDREPL()
$END$
*/
/* $DOC$
* $FUNCNAME$
* SETATLIKE()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Determine scan behaviour in some string functions
* $SYNTAX$
* SETATLIKE ([<nMode>] [, <[@]cWildcard>]) --> nOldMode
* $ARGUMENTS$
* [<nMode>] CT_SETATLIKE_EXACT -> characters are compared exactly
* CT_SETATLIKE_WILDCARD -> characters are compared using
* a wildcard character
* The default value is CT_SETATLIKE_EXACT.
* [<[@]cWildcard>] determines the character that is subsequently used
* as a wildcard character for substring scanning.
* The default value is "?".
* NEW: If this parameter is passed by reference [@],
* the current wildcard character is stored in
* <cWildcard>.
* $RETURNS$
* nOldMode old (if nMode is a numeric value) or
* current state of the switch
* $DESCRIPTION$
* In the following CT3 functions, strings are compared on a character
* base:
*
* ATADJUST() ATNUM() AFTERATNUM()
* BEFOREATNUM() ATREPL() NUMAT()
* STRDIFF()
*
* With the SETATLIKE function, one can determine when characters are
* considered to match within these functions. If CT_SETATLIKE_WILDCARD
* is set (e.g. "?"), then "?" matches every other character.
*
* <nMode> can be one of the following values that are defined
* in ct.ch
*
* Definition | Value
* ----------------------|------
* CT_SETATLIKE_EXACT | 0
* CT_SETATLIKE_WILDCARD | 1
*
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* This function is fully CT3 compatible, but allows to pass the
* second parameter by reference so that the current wildcard character
* can be determined.
* $PLATFORMS$
* All
* $FILES$
* Header is ct.ch, library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SETATLIKE()
$CATEGORY$
CT3 string functions
$ONELINER$
Determine scan behaviour in some string functions
$SYNTAX$
SETATLIKE ([<nMode>] [, <[@]cWildcard>]) --> nOldMode
$ARGUMENTS$
[<nMode>] CT_SETATLIKE_EXACT -> characters are compared exactly
CT_SETATLIKE_WILDCARD -> characters are compared using
a wildcard character
The default value is CT_SETATLIKE_EXACT.
[<[@]cWildcard>] determines the character that is subsequently used
as a wildcard character for substring scanning.
The default value is "?".
NEW: If this parameter is passed by reference [@],
the current wildcard character is stored in
<cWildcard>.
$RETURNS$
nOldMode old (if nMode is a numeric value) or
current state of the switch
$DESCRIPTION$
In the following CT3 functions, strings are compared on a character
base:
ATADJUST() ATNUM() AFTERATNUM()
BEFOREATNUM() ATREPL() NUMAT()
STRDIFF()
With the SETATLIKE function, one can determine when characters are
considered to match within these functions. If CT_SETATLIKE_WILDCARD
is set (e.g. "?"), then "?" matches every other character.
<nMode> can be one of the following values that are defined
in ct.ch
Definition | Value
----------------------|------
CT_SETATLIKE_EXACT | 0
CT_SETATLIKE_WILDCARD | 1
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
This function is fully CT3 compatible, but allows to pass the
second parameter by reference so that the current wildcard character
can be determined.
$PLATFORMS$
All
$FILES$
Header is ct.ch, library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,194 +2,194 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* BOM()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* _B_egin _O_f _M_onth
* $SYNTAX$
* BOM( [<dDate>] ) -> dDateBeginOfMonth
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* BOM() is compatible with CT3's BOM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* EOM(),BOQ(),EOQ(),BOY(),EOY()
* $END$
/* $DOC$
$FUNCNAME$
BOM()
$CATEGORY$
CT3 date and time functions
$ONELINER$
_B_egin _O_f _M_onth
$SYNTAX$
BOM( [<dDate>] ) -> dDateBeginOfMonth
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
BOM() is compatible with CT3's BOM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
EOM(),BOQ(),EOQ(),BOY(),EOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* EOM()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* _E_nd _O_f _M_onth
* $SYNTAX$
* EOM( [<dDate>] ) -> dDateEndOfMonth
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* EOM() is compatible with CT3's EOM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* BOM(),BOQ(),EOQ(),BOY(),EOY()
* $END$
/* $DOC$
$FUNCNAME$
EOM()
$CATEGORY$
CT3 date and time functions
$ONELINER$
_E_nd _O_f _M_onth
$SYNTAX$
EOM( [<dDate>] ) -> dDateEndOfMonth
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
EOM() is compatible with CT3's EOM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
BOM(),BOQ(),EOQ(),BOY(),EOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* BOQ()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* _B_egin _O_f _Q_uarter
* $SYNTAX$
* BOQ( [<dDate>] ) -> dDateBeginOfQuarter
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* BOQ() is compatible with CT3's BOQ().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* BOM(),EOM(),EOQ(),BOY(),EOY()
* $END$
/* $DOC$
$FUNCNAME$
BOQ()
$CATEGORY$
CT3 date and time functions
$ONELINER$
_B_egin _O_f _Q_uarter
$SYNTAX$
BOQ( [<dDate>] ) -> dDateBeginOfQuarter
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
BOQ() is compatible with CT3's BOQ().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
BOM(),EOM(),EOQ(),BOY(),EOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* EOQ()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* _E_nd _O_f _Q_uarter
* $SYNTAX$
* EOQ( [<dDate>] ) -> dDateEndOfQuarter
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* EOQ() is compatible with CT3's EOQ().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* BOM(),EOM(),BOQ(),BOY(),EOY()
* $END$
/* $DOC$
$FUNCNAME$
EOQ()
$CATEGORY$
CT3 date and time functions
$ONELINER$
_E_nd _O_f _Q_uarter
$SYNTAX$
EOQ( [<dDate>] ) -> dDateEndOfQuarter
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
EOQ() is compatible with CT3's EOQ().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
BOM(),EOM(),BOQ(),BOY(),EOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* BOY()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* _B_egin _O_f _Y_ear
* $SYNTAX$
* BOY( [<dDate>] ) -> dDateBeginOfYear
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* BOY() is compatible with CT3's BOY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* BOM(),EOM(),BOQ(),EOQ(),EOY()
* $END$
/* $DOC$
$FUNCNAME$
BOY()
$CATEGORY$
CT3 date and time functions
$ONELINER$
_B_egin _O_f _Y_ear
$SYNTAX$
BOY( [<dDate>] ) -> dDateBeginOfYear
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
BOY() is compatible with CT3's BOY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
BOM(),EOM(),BOQ(),EOQ(),EOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* EOY()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* _E_nd _O_f _Y_ear
* $SYNTAX$
* EOY( [<dDate>] ) -> dDateEndOfYear
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* EOY() is compatible with CT3's EOY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* BOM(),EOM(),BOQ(),EOQ(),BOY()
* $END$
/* $DOC$
$FUNCNAME$
EOY()
$CATEGORY$
CT3 date and time functions
$ONELINER$
_E_nd _O_f _Y_ear
$SYNTAX$
EOY( [<dDate>] ) -> dDateEndOfYear
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
EOY() is compatible with CT3's EOY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
BOM(),EOM(),BOQ(),EOQ(),BOY()
$END$
*/

View File

@@ -2,473 +2,473 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CTODOW()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* convert name of day of the week to its ordinal number
* $SYNTAX$
* CTODOW( <cName> ) -> nOrdinal
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* CTODOW() is compatible with CT3's CTODOW().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* NTOCDOW()
* $END$
/* $DOC$
$FUNCNAME$
CTODOW()
$CATEGORY$
CT3 date and time functions
$ONELINER$
convert name of day of the week to its ordinal number
$SYNTAX$
CTODOW( <cName> ) -> nOrdinal
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
CTODOW() is compatible with CT3's CTODOW().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
NTOCDOW()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTOMONTH()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* convert name of month to its ordinal number
* $SYNTAX$
* CTOMONTH( <cName> ) -> nOrdinal
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* CTOMONTH() is compatible with CT3's CTOMONTH().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* NTOCMONTH()
* $END$
/* $DOC$
$FUNCNAME$
CTOMONTH()
$CATEGORY$
CT3 date and time functions
$ONELINER$
convert name of month to its ordinal number
$SYNTAX$
CTOMONTH( <cName> ) -> nOrdinal
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
CTOMONTH() is compatible with CT3's CTOMONTH().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
NTOCMONTH()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DMY()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Returns the date as a string in DD Month YY format
* $SYNTAX$
* DMY( [<dDate>][, <lMode>] ) -> cDateString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* Returns the date as a string in DD Month YY format. If lmode
* is TRUE, a "." is inserted after the DD
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* DMY() is compatible with CT3's DMY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* MDY()
* $END$
/* $DOC$
$FUNCNAME$
DMY()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Returns the date as a string in DD Month YY format
$SYNTAX$
DMY( [<dDate>][, <lMode>] ) -> cDateString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
Returns the date as a string in DD Month YY format. If lmode
is TRUE, a "." is inserted after the DD
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
DMY() is compatible with CT3's DMY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
MDY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* MDY()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Returns the date as a string in Month DD, YY or Month DD, YYYY
* $SYNTAX$
* MDY( [<dDate>] ) -> cDateString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* Returns the date as a string in Month DD, YY or Month DD, YYYY
* If dDate is NULL, the system date is used
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* MDY() is compatible with CT3's MDY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* DMY()
* $END$
/* $DOC$
$FUNCNAME$
MDY()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Returns the date as a string in Month DD, YY or Month DD, YYYY
$SYNTAX$
MDY( [<dDate>] ) -> cDateString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
Returns the date as a string in Month DD, YY or Month DD, YYYY
If dDate is NULL, the system date is used
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
MDY() is compatible with CT3's MDY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
DMY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ADDMONTH()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* add months to a date
* $SYNTAX$
* ADDMONTH( [<dDate>,] <nMonths> ) -> dShiftedDate
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* ADDMONTH() is compatible with CT3's ADDMOTH().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
ADDMONTH()
$CATEGORY$
CT3 date and time functions
$ONELINER$
add months to a date
$SYNTAX$
ADDMONTH( [<dDate>,] <nMonths> ) -> dShiftedDate
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
ADDMONTH() is compatible with CT3's ADDMOTH().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* DOY()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Determines the day of the year for a specific date
* $SYNTAX$
* DMY( [<dDate>] ) -> nDayOfYear
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* Determines the day of the year for a specific date
* if dDate is invalid, returns 0
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* DOY() is compatible with CT3's DOY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
DOY()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Determines the day of the year for a specific date
$SYNTAX$
DMY( [<dDate>] ) -> nDayOfYear
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
Determines the day of the year for a specific date
if dDate is invalid, returns 0
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
DOY() is compatible with CT3's DOY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* ISLEAP()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* determines of year of date is a leap year
* $SYNTAX$
* ISLEAP( [<dDate>] ) -> lIsLeap
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* ISLEAP() is compatible with CT3's ISLEAP().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
ISLEAP()
$CATEGORY$
CT3 date and time functions
$ONELINER$
determines of year of date is a leap year
$SYNTAX$
ISLEAP( [<dDate>] ) -> lIsLeap
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
ISLEAP() is compatible with CT3's ISLEAP().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* DAYSTOMONTH()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Total number of days from first of Jan to beginning of nMonth.
* $SYNTAX$
* DAYSTOMONTH( <nMonth>, <lLeapYear> ) -> nDaysToMonth
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* lLeap is FALSE for a non-leap year but TRUE if it is. If so and nMonth
* is greater than 2, ndays is incremented
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* DAYSTOMONTH() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* DAYSINMONTH()
* $END$
/* $DOC$
$FUNCNAME$
DAYSTOMONTH()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Total number of days from first of Jan to beginning of nMonth.
$SYNTAX$
DAYSTOMONTH( <nMonth>, <lLeapYear> ) -> nDaysToMonth
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
lLeap is FALSE for a non-leap year but TRUE if it is. If so and nMonth
is greater than 2, ndays is incremented
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
DAYSTOMONTH() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
DAYSINMONTH()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DAYSINMONTH()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Returns the number of days in month
* $SYNTAX$
* DAYSINMONTH (<nMonth>, <lLeapYear>) -> nDaysInMonth
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* DAYSINMONTH() is a new function in Harbour's CT3 library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* DAYSTOMONTH()
* $END$
/* $DOC$
$FUNCNAME$
DAYSINMONTH()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Returns the number of days in month
$SYNTAX$
DAYSINMONTH (<nMonth>, <lLeapYear>) -> nDaysInMonth
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
DAYSINMONTH() is a new function in Harbour's CT3 library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
DAYSTOMONTH()
$END$
*/
/* $DOC$
* $FUNCNAME$
* QUARTER()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Returns a number equal to the quarter in which a date falls
* $SYNTAX$
* QUARTER( [<dDate>] ) -> nQuarter
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* Returns a number equal to the quarter in which ddate
* falls. If ddate is empty, the system date is employed.
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* QUARTER() is compatible with CT3's QUARTER().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
QUARTER()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Returns a number equal to the quarter in which a date falls
$SYNTAX$
QUARTER( [<dDate>] ) -> nQuarter
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
Returns a number equal to the quarter in which ddate
falls. If ddate is empty, the system date is employed.
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
QUARTER() is compatible with CT3's QUARTER().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* LASTDAYOM()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Returns the the number of days in the month.
* $SYNTAX$
* LASTDAYOM( [<dDate|nMonth>] ) -> nDaysInMonth
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* <dDate|nMonth> can be a date or a month number. If empty uses the
* system date. If nMonth is a 2, lastdayom() will not know if it
* is a leap year or not. If dDate is invalid, returns 0
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* LASTDAYOM() is compatible with CT3's LASTDAYOM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* EOM()
* $END$
/* $DOC$
$FUNCNAME$
LASTDAYOM()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Returns the the number of days in the month.
$SYNTAX$
LASTDAYOM( [<dDate|nMonth>] ) -> nDaysInMonth
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
<dDate|nMonth> can be a date or a month number. If empty uses the
system date. If nMonth is a 2, lastdayom() will not know if it
is a leap year or not. If dDate is invalid, returns 0
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
LASTDAYOM() is compatible with CT3's LASTDAYOM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
EOM()
$END$
*/
/* $DOC$
* $FUNCNAME$
* NTOCDOW()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* (num of day) -> day name
* $SYNTAX$
* NTOCDOW( <nDay> ) -> cDay
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* NTOCDOW() is compatible with CT3's NTOCDOW().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTODOW()
* $END$
/* $DOC$
$FUNCNAME$
NTOCDOW()
$CATEGORY$
CT3 date and time functions
$ONELINER$
(num of day) -> day name
$SYNTAX$
NTOCDOW( <nDay> ) -> cDay
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
NTOCDOW() is compatible with CT3's NTOCDOW().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTODOW()
$END$
*/
/* $DOC$
* $FUNCNAME$
* NTOCMONTH()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* (num of month ) -> Month Name
* $SYNTAX$
* NTOCMONTH( <nMonth> ) -> cMonth
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* NTOCMONTH() is compatible with CT3's NTOCMONTH().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTOMONTH()
* $END$
/* $DOC$
$FUNCNAME$
NTOCMONTH()
$CATEGORY$
CT3 date and time functions
$ONELINER$
(num of month ) -> Month Name
$SYNTAX$
NTOCMONTH( <nMonth> ) -> cMonth
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
NTOCMONTH() is compatible with CT3's NTOCMONTH().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTOMONTH()
$END$
*/
/* $DOC$
* $FUNCNAME$
* WEEK()
* $CATEGORY$
* CT3 date and time functions
* $ONELINER$
* Returns the calendar week a number
* $SYNTAX$
* WEEK( [<dDate>][, <lSWN>] ) -> nWeek
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* Returns the calendar week a number. If no date is specified,
* the system date is used. An empty date via hb_SToD("")
* returns 0.
* If <lSWN> is .T., week() will calculate the "simple week number", defined by
* - week #1 starts on January, 1st
* - week #(n+1) starts seven days after start of week #n
* If <lSWN> is .F. (default), the ISO8601 week number, defined by
* - weeks start on mondays
* - week #1 is the one that includes January, 4
* will be calculated
* TODO: add further documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* WEEK() is compatible with CT3's WEEK().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
WEEK()
$CATEGORY$
CT3 date and time functions
$ONELINER$
Returns the calendar week a number
$SYNTAX$
WEEK( [<dDate>][, <lSWN>] ) -> nWeek
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
Returns the calendar week a number. If no date is specified,
the system date is used. An empty date via hb_SToD("")
returns 0.
If <lSWN> is .T., week() will calculate the "simple week number", defined by
- week #1 starts on January, 1st
- week #(n+1) starts seven days after start of week #n
If <lSWN> is .F. (default), the ISO8601 week number, defined by
- weeks start on mondays
- week #1 is the one that includes January, 4
will be calculated
TODO: add further documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
WEEK() is compatible with CT3's WEEK().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,219 +2,219 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* WAITPERIOD()
* $CATEGORY$
* HBCT date and time functions
* $ONELINER$
* Pauses a specified time in increments of 1/100 seconds
* $SYNTAX$
* WAITPERIOD( [<nDelay>] ) --> lNotElapsed
* $ARGUMENTS$
* <nDelay> Designates the waiting period at initialization in
* 1/100ths of seconds. Values from 1 to 8, 640, 000 (one day) are
* possible.
* $RETURNS$
* WAITPERIOD() returns .T., if the time span designated at initialization
* has not elapsed.
* $DESCRIPTION$
* This function sets a time span for a xHarbour DO WHILE loop to run.
* The function must initialize prior to the loop, since you must specify
* the <nDelay> parameter in 1/100th seconds. Subsequently, the function
* can be implemented without a parameter for additional loop conditions.
* It returns .T., as long as the designated time span has not yet run out.
*
* Note
*
* The function notes the status of the internal timer at
* initialization. From that point on, the initialization should always
* precede the respective DO WHILE; otherwise, the time delay is
* incorrect. The passing of midnight (the time resets to the 0 value)
* is taken into account.
* $EXAMPLES$
* Run a loop for 5 seconds:
*
* WAITPERIOD( 500 ) // Initialization, 5 seconds
* DO WHILE <cond1> .AND. <cond2> .AND. WAITPERIOD()
* *...
* ENDDO
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* WAITPERIOD() is Clipper Tools compatible.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
WAITPERIOD()
$CATEGORY$
HBCT date and time functions
$ONELINER$
Pauses a specified time in increments of 1/100 seconds
$SYNTAX$
WAITPERIOD( [<nDelay>] ) --> lNotElapsed
$ARGUMENTS$
<nDelay> Designates the waiting period at initialization in
1/100ths of seconds. Values from 1 to 8, 640, 000 (one day) are
possible.
$RETURNS$
WAITPERIOD() returns .T., if the time span designated at initialization
has not elapsed.
$DESCRIPTION$
This function sets a time span for a xHarbour DO WHILE loop to run.
The function must initialize prior to the loop, since you must specify
the <nDelay> parameter in 1/100th seconds. Subsequently, the function
can be implemented without a parameter for additional loop conditions.
It returns .T., as long as the designated time span has not yet run out.
Note
The function notes the status of the internal timer at
initialization. From that point on, the initialization should always
precede the respective DO WHILE; otherwise, the time delay is
incorrect. The passing of midnight (the time resets to the 0 value)
is taken into account.
$EXAMPLES$
Run a loop for 5 seconds:
WAITPERIOD( 500 ) // Initialization, 5 seconds
DO WHILE <cond1> .AND. <cond2> .AND. WAITPERIOD()
*...
ENDDO
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
WAITPERIOD() is Clipper Tools compatible.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* TIMEVALID()
* $CATEGORY$
* HBCT Date and Time Functions
* $ONELINER$
* Determines whether a specIFied time is valid
* $SYNTAX$
* TIMEVALID( <cTime> ) --> lValid
* $ARGUMENTS$
* <cTime> Designates a character string that contains the time to
* test.
* $RETURNS$
* TIMEVALID() RETURNs .T. when <cTime> is a valid time; or .F. when
* <cTime> is an invalid time.
* $DESCRIPTION$
* With input that requires time manipulation, writing your own UDF to
* check time inputs was unavoidable up to now. TIMEVALID() permits
* Complete checking of a time designation. You can use this FUNCTION
* effectively with a VALID clause within a READ mask.
*
* Note
*
* Note the format for time designations. There must always be
* two digits for hours, minutes, seconds, and hundredths; otherwise,
* the time it is regarded as invalid. Valid examples are "12",
* "12:59", "12:59:59", and "12:59:59:99". By contrast, invalid
* examples are "24", "12:60", or "12:1", and/or "12:". IF you work
* with time strings that are not completely filled and that you need to
* check with TIMEVALID(), then they must be TRIMmed prior to the use of
* TIMEVALID() (see following Examples).
* $EXAMPLES$
* Using the VALID clause with TRIM, all valid times are
* accepted, even IF no seconds or minutes are specIFied:
*
* cBegin := SPACE( 11 )
* @ 5, 10 SAY "Please input time for beginning work:";
* GET cBegin VALID TIMEVALID( RTRIM( cBegin ) )
* READ
*
* Using a VALID clause without TRIM, hours and minutes must be
* specified, so that TIMEVALID() can confirm a valid time:
*
* cBegin := SPACE( 5 )
* @ 5, 10 SAY "Please input time for beginning work:";
* GET cBegin VALID TIMEVALID( cBegin )
* READ
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* This function is CA-Cl*pper Tools compatible.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* SETTIME()
* $END$
/* $DOC$
$FUNCNAME$
TIMEVALID()
$CATEGORY$
HBCT Date and Time Functions
$ONELINER$
Determines whether a specIFied time is valid
$SYNTAX$
TIMEVALID( <cTime> ) --> lValid
$ARGUMENTS$
<cTime> Designates a character string that contains the time to
test.
$RETURNS$
TIMEVALID() RETURNs .T. when <cTime> is a valid time; or .F. when
<cTime> is an invalid time.
$DESCRIPTION$
With input that requires time manipulation, writing your own UDF to
check time inputs was unavoidable up to now. TIMEVALID() permits
Complete checking of a time designation. You can use this FUNCTION
effectively with a VALID clause within a READ mask.
Note
Note the format for time designations. There must always be
two digits for hours, minutes, seconds, and hundredths; otherwise,
the time it is regarded as invalid. Valid examples are "12",
"12:59", "12:59:59", and "12:59:59:99". By contrast, invalid
examples are "24", "12:60", or "12:1", and/or "12:". IF you work
with time strings that are not completely filled and that you need to
check with TIMEVALID(), then they must be TRIMmed prior to the use of
TIMEVALID() (see following Examples).
$EXAMPLES$
Using the VALID clause with TRIM, all valid times are
accepted, even IF no seconds or minutes are specIFied:
cBegin := SPACE( 11 )
@ 5, 10 SAY "Please input time for beginning work:";
GET cBegin VALID TIMEVALID( RTRIM( cBegin ) )
READ
Using a VALID clause without TRIM, hours and minutes must be
specified, so that TIMEVALID() can confirm a valid time:
cBegin := SPACE( 5 )
@ 5, 10 SAY "Please input time for beginning work:";
GET cBegin VALID TIMEVALID( cBegin )
READ
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
This function is CA-Cl*pper Tools compatible.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
SETTIME()
$END$
*/
/* $DOC$
* $FUNCNAME$
* SETTIME()
* $CATEGORY$
* HBCT Date and Time Functions
* $ONELINER$
* Sets the system clock
* $SYNTAX$
* SETTIME( <cTime>, [<lMode>] ) --> lSet
* $ARGUMENTS$
* <cTime> Designates a character string that contains the time that
* is to become the system time.
*
* <lMode> Designates whether the time should also be set in the
* CMOS-RAM of an AT. The default is do not write to CMOS-RAM. Note that in
* Windows platform this adjust is automatic, therefore this parameter is
* without efect.
* $RETURNS$
* The FUNCTION RETURNs .T. when the time is set successfully.
* $DESCRIPTION$
* When you use this FUNCTION to convert the time into the system time from
* within your xHarbour application, all files acquire this time with
* each write procedure.
* $EXAMPLES$
* Set the system time in each case; but the hardware clock only
* on an AT:
*
* cNewTime := "10:20:00"
* IF ISAT()
* SETTIME( cNewTime, .T. )
* ELSE
* SETTIME( cNewTime )
* ENDIF
*
* Or, more compactly:
*
* SETTIME( cNewTime, ISAT() )
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* This function is CA-Cl*pper Tools compatible.
* $PLATFORMS$
* Windows, Linux
* $FILES$
* Library is libct.
* $SEEALSO$
* SETDATE(),TIMEVALID()
* $END$
/* $DOC$
$FUNCNAME$
SETTIME()
$CATEGORY$
HBCT Date and Time Functions
$ONELINER$
Sets the system clock
$SYNTAX$
SETTIME( <cTime>, [<lMode>] ) --> lSet
$ARGUMENTS$
<cTime> Designates a character string that contains the time that
is to become the system time.
<lMode> Designates whether the time should also be set in the
CMOS-RAM of an AT. The default is do not write to CMOS-RAM. Note that in
Windows platform this adjust is automatic, therefore this parameter is
without efect.
$RETURNS$
The FUNCTION RETURNs .T. when the time is set successfully.
$DESCRIPTION$
When you use this FUNCTION to convert the time into the system time from
within your xHarbour application, all files acquire this time with
each write procedure.
$EXAMPLES$
Set the system time in each case; but the hardware clock only
on an AT:
cNewTime := "10:20:00"
IF ISAT()
SETTIME( cNewTime, .T. )
ELSE
SETTIME( cNewTime )
ENDIF
Or, more compactly:
SETTIME( cNewTime, ISAT() )
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
This function is CA-Cl*pper Tools compatible.
$PLATFORMS$
Windows, Linux
$FILES$
Library is libct.
$SEEALSO$
SETDATE(),TIMEVALID()
$END$
*/
/* $DOC$
* $FUNCNAME$
* SETDATE()
* $CATEGORY$
* HBCT Date and Time Functions
* $ONELINER$
* Sets the system date
* $SYNTAX$
* SETDATE( <dDate>, [<lMode>] ) --> lSet
* $ARGUMENTS$
* <dDate> Designates which date to use to set the system date.
*
* <lMode> Designates whether the date should also be set in the CMOS-
* RAM of an AT. The default is do not write (.F.). Note that in Windows
* plataform this adjust is automatic, therefore this parameter is without
* efect.
* $RETURNS$
* SETDATE() RETURNs .T. when the date is successfully set.
* $DESCRIPTION$
* When you use this FUNCTION to set the system date from within your
* xHarbour application, all files acquire this date with each write
* procedure.
* $EXAMPLES$
* Set the system date in each case; but the hardware clock only
* on an AT:
*
* dNewDate := SToD( "19910730" )
* IF ISAT()
* SETDATE( dNewDate, .T. )
* ELSE
* SETDATE( dNewDate )
* ENDIF
*
* Or, more compactly:
*
* SETDATE( dNewDate, ISAT() )
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* This function is CA-Cl*pper Tools compatible.
* $PLATFORMS$
* Windows, Linux
* $FILES$
* Library is libct.
* $SEEALSO$
* SETTIME()
* $END$
/* $DOC$
$FUNCNAME$
SETDATE()
$CATEGORY$
HBCT Date and Time Functions
$ONELINER$
Sets the system date
$SYNTAX$
SETDATE( <dDate>, [<lMode>] ) --> lSet
$ARGUMENTS$
<dDate> Designates which date to use to set the system date.
<lMode> Designates whether the date should also be set in the CMOS-
RAM of an AT. The default is do not write (.F.). Note that in Windows
plataform this adjust is automatic, therefore this parameter is without
efect.
$RETURNS$
SETDATE() RETURNs .T. when the date is successfully set.
$DESCRIPTION$
When you use this FUNCTION to set the system date from within your
xHarbour application, all files acquire this date with each write
procedure.
$EXAMPLES$
Set the system date in each case; but the hardware clock only
on an AT:
dNewDate := SToD( "19910730" )
IF ISAT()
SETDATE( dNewDate, .T. )
ELSE
SETDATE( dNewDate )
ENDIF
Or, more compactly:
SETDATE( dNewDate, ISAT() )
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
This function is CA-Cl*pper Tools compatible.
$PLATFORMS$
Windows, Linux
$FILES$
Library is libct.
$SEEALSO$
SETTIME()
$END$
*/

View File

@@ -2,91 +2,91 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* MANTISSA()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
* Evaluate the mantissa of a floating point number
* $SYNTAX$
* MANTISSA( <nFloatingPointNumber> ) --> nMantissa
* $ARGUMENTS$
* <nFloatingPointNumber> Designate any Harbour number.
* $RETURNS$
* MANTISSA() returns the mantissa of the <nFloatingPointNumber> number.
* $DESCRIPTION$
* This function supplements EXPONENT() to return the mantissa of the
* <nFloatingPointNumber> number.
*
* Note: The mantissa value can be 0 or in the range of 1 to 2.
*
* The following calculation reproduces the original value:
*
* MANTISSA( <nFloatingPointNumber> ) * 2 ^ EXPONENT( <nFloatingPointNumber> ) =
* <nFloatingPointNumber>
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* MANTISSA() is compatible with CT3's MANTISSA().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* EXPONENT()
* $END$
/* $DOC$
$FUNCNAME$
MANTISSA()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
Evaluate the mantissa of a floating point number
$SYNTAX$
MANTISSA( <nFloatingPointNumber> ) --> nMantissa
$ARGUMENTS$
<nFloatingPointNumber> Designate any Harbour number.
$RETURNS$
MANTISSA() returns the mantissa of the <nFloatingPointNumber> number.
$DESCRIPTION$
This function supplements EXPONENT() to return the mantissa of the
<nFloatingPointNumber> number.
Note: The mantissa value can be 0 or in the range of 1 to 2.
The following calculation reproduces the original value:
MANTISSA( <nFloatingPointNumber> ) * 2 ^ EXPONENT( <nFloatingPointNumber> ) =
<nFloatingPointNumber>
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
MANTISSA() is compatible with CT3's MANTISSA().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
EXPONENT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* EXPONENT()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
* Evaluate the exponent of a floating point number
* $SYNTAX$
* EXPONENT( <nFloatingPointNumber> ) --> nExponent
* $ARGUMENTS$
* <nFloatingPointNumber> Designate any Harbour number.
* $RETURNS$
* EXPONENT() returns the exponent of the <nFloatingPointNumber> number
* in base 2.
* $DESCRIPTION$
* This function supplements MANTISSA() to return the exponent of the
* <nFloatingPointNumber> number.
*
* Values > 1 or values < -1 return a positive number 0 to 1023.
*
* Values < 1 or values > -1 return a negative number -1 to -1023.
*
* The EXPONENT( 0 ), return 0.
*
* The following calculation reproduces the original value:
*
* 2^EXPONENT(<nFloatingPointNumber>) * MANTISSA(<nFloatingPointNumber>) =
* <nFloatingPointNumber>
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* EXPONENT() is compatible with CT3's EXPONENT()
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* MANTISSA()
* $END$
/* $DOC$
$FUNCNAME$
EXPONENT()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
Evaluate the exponent of a floating point number
$SYNTAX$
EXPONENT( <nFloatingPointNumber> ) --> nExponent
$ARGUMENTS$
<nFloatingPointNumber> Designate any Harbour number.
$RETURNS$
EXPONENT() returns the exponent of the <nFloatingPointNumber> number
in base 2.
$DESCRIPTION$
This function supplements MANTISSA() to return the exponent of the
<nFloatingPointNumber> number.
Values > 1 or values < -1 return a positive number 0 to 1023.
Values < 1 or values > -1 return a negative number -1 to -1023.
The EXPONENT( 0 ), return 0.
The following calculation reproduces the original value:
2^EXPONENT(<nFloatingPointNumber>) * MANTISSA(<nFloatingPointNumber>) =
<nFloatingPointNumber>
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
EXPONENT() is compatible with CT3's EXPONENT()
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
MANTISSA()
$END$
*/

View File

@@ -2,255 +2,255 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FV()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Future value of a capital
* $SYNTAX$
* FV( nDeposit, nInterest, nPeriods ) --> nFutureValue
* $ARGUMENTS$
* <nDeposit> amount of money invested per period
* <nInterest> rate of interest per period, 1 == 100%
* <nPeriods> period count
* $RETURNS$
* <nFutureValue> Total value of the capital after <nPeriods> of
* paying <nDeposit> and <nInterest> interest being
* paid every period and added to the capital (resulting
* in compound interest)
* $DESCRIPTION$
* FV() calculates the value of a capital after <nPeriods> periods.
* Starting with a value of 0, every period, <nDeposit>
* (Dollars, Euros, Yens, ...) and an interest of <nInterest> for the
* current capital are added for the capital (<nInterest>=Percent/100).
* Thus, one gets the non-linear effects of compound interests:
* value in period 0 = 0
* value in period 1 = ((value in period 0)*(1+<nInterest>/100)) + <nDeposit>
* value in period 2 = ((value in period 1)*(1+<nInterest>/100)) + <nDeposit>
* etc....
* value in period <nPeriod> = ((value in period <nPeriod>-1)*(1+<nInterest>/100))< + <nDeposit>
* = <nDeposit> * sum from i=0 to <nPeriod>-1 over (1+<nInterest>/100)^i
* = <nDeposit> * ((1+<nInterest>/100)^n-1) / (<nInterest>/100)
* $EXAMPLES$
* // Payment of 1000 per year for 10 years at a interest rate
* // of 5 per cent per year
*
* ? fv( 1000, 0.05, 10 ) // --> 12577.893
* $TESTS$
* fv( 1000, 0.00, 10 ) == 10000.0
* fv( 1000, 0.05, 10 ) == 12577.893
* $STATUS$
* Ready
* $COMPLIANCE$
* FV() is compatible with CT3's FV().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* PV(),PAYMENT(),PERIODS(),RATE()
* $END$
/* $DOC$
$FUNCNAME$
FV()
$CATEGORY$
CT3 math functions
$ONELINER$
Future value of a capital
$SYNTAX$
FV( nDeposit, nInterest, nPeriods ) --> nFutureValue
$ARGUMENTS$
<nDeposit> amount of money invested per period
<nInterest> rate of interest per period, 1 == 100%
<nPeriods> period count
$RETURNS$
<nFutureValue> Total value of the capital after <nPeriods> of
paying <nDeposit> and <nInterest> interest being
paid every period and added to the capital (resulting
in compound interest)
$DESCRIPTION$
FV() calculates the value of a capital after <nPeriods> periods.
Starting with a value of 0, every period, <nDeposit>
(Dollars, Euros, Yens, ...) and an interest of <nInterest> for the
current capital are added for the capital (<nInterest>=Percent/100).
Thus, one gets the non-linear effects of compound interests:
value in period 0 = 0
value in period 1 = ((value in period 0)*(1+<nInterest>/100)) + <nDeposit>
value in period 2 = ((value in period 1)*(1+<nInterest>/100)) + <nDeposit>
etc....
value in period <nPeriod> = ((value in period <nPeriod>-1)*(1+<nInterest>/100))< + <nDeposit>
= <nDeposit> * sum from i=0 to <nPeriod>-1 over (1+<nInterest>/100)^i
= <nDeposit> * ((1+<nInterest>/100)^n-1) / (<nInterest>/100)
$EXAMPLES$
// Payment of 1000 per year for 10 years at a interest rate
// of 5 per cent per year
? fv( 1000, 0.05, 10 ) // --> 12577.893
$TESTS$
fv( 1000, 0.00, 10 ) == 10000.0
fv( 1000, 0.05, 10 ) == 12577.893
$STATUS$
Ready
$COMPLIANCE$
FV() is compatible with CT3's FV().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
PV(),PAYMENT(),PERIODS(),RATE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* PV()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Present value of a loan
* $SYNTAX$
* PV( nPayment, nInterest, nPeriods ) --> nPresentValue
* $ARGUMENTS$
* <nPayment> amount of money paid back per period
* <nInterest> rate of interest per period, 1 == 100%
* <nPeriods> period count
* $RETURNS$
* <nPresentValue> Present value of a loan when one is paying back
* <nDeposit> per period at a rate of interest of
* <nInterest> per period
* $DESCRIPTION$
* PV() calculates the present value of a loan that is paid back
* in <nPeriods> payments of <nPayment> (Dollars, Euros, Yens,...)
* while the rate of interest is <nInterest> per period:
* debt in period 0 = <nPresentValue>
* debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100)
* debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100)
* etc...
* debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100)
* -> has to be 0, so
* <nPresentValue> = <nPayment>*(1-(1+<nInterest>/100)^(-n))/(<nInterest>/100)
* $EXAMPLES$
* // You can afford to pay back 100 Dollars per month for 5 years
* // at a interest rate of 0.5% per month (6% per year), so instead
* // of 6000 Dollars (the amount you will pay back) the bank will pay
* // you
*
* ? pv( 100, 0.005, 60 ) // --> 5172.56
* $TESTS$
* pv( 100, 0.0, 60 ) == 6000.0
* pv( 100, 0.005, 60 ) == 5172.56
* $STATUS$
* Ready
* $COMPLIANCE$
* PV() is compatible with CT3's PV().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* FV(),PAYMENT(),PERIODS(),RATE()
* $END$
/* $DOC$
$FUNCNAME$
PV()
$CATEGORY$
CT3 math functions
$ONELINER$
Present value of a loan
$SYNTAX$
PV( nPayment, nInterest, nPeriods ) --> nPresentValue
$ARGUMENTS$
<nPayment> amount of money paid back per period
<nInterest> rate of interest per period, 1 == 100%
<nPeriods> period count
$RETURNS$
<nPresentValue> Present value of a loan when one is paying back
<nDeposit> per period at a rate of interest of
<nInterest> per period
$DESCRIPTION$
PV() calculates the present value of a loan that is paid back
in <nPeriods> payments of <nPayment> (Dollars, Euros, Yens,...)
while the rate of interest is <nInterest> per period:
debt in period 0 = <nPresentValue>
debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100)
debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100)
etc...
debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100)
-> has to be 0, so
<nPresentValue> = <nPayment>*(1-(1+<nInterest>/100)^(-n))/(<nInterest>/100)
$EXAMPLES$
// You can afford to pay back 100 Dollars per month for 5 years
// at a interest rate of 0.5% per month (6% per year), so instead
// of 6000 Dollars (the amount you will pay back) the bank will pay
// you
? pv( 100, 0.005, 60 ) // --> 5172.56
$TESTS$
pv( 100, 0.0, 60 ) == 6000.0
pv( 100, 0.005, 60 ) == 5172.56
$STATUS$
Ready
$COMPLIANCE$
PV() is compatible with CT3's PV().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
FV(),PAYMENT(),PERIODS(),RATE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* PAYMENT()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Payments for a loan
* $SYNTAX$
* PAYMENT( nLoan, nInterest, nPeriods ) --> nPayment
* $ARGUMENTS$
* <nLoan> amount of money you get from the bank
* <nInterest> rate of interest per period, 1 == 100%
* <nPeriods> period count
* $RETURNS$
* <nPayment> Periodical payment one has to make to pay the
* loan <nLoan> back
* $DESCRIPTION$
* PAYMENT() calculates the payment one has to make periodically
* to pay back a loan <nLoan> within <nPeriods> periods and for a
* rate of interest <nInterest> per period.
* debt in period 0 = <nLoan>
* debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100)
* debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100)
* etc...
* debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100)
* -> has to be 0, so
* <nPayment> = <nLoan>*(<nInterest>/100)/(1-(1+<nInterest>/100)^(-n))
* $EXAMPLES$
* // You get a loan of 5172.56 at a interest rate of 0.5% per
* // month (6% per year).
* // For 5 years, you have to pay back every month
*
* ? payment( 5172.56, 0.005, 60 ) // --> 100.00
* $TESTS$
* payment( 5172.56, 0.0, 60 ) == 86.21
* payment( 5172.56, 0.005, 60 ) == 100.00
* $STATUS$
* Ready
* $COMPLIANCE$
* PAYMENT() is compatible with CT3's PAYMENT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* PV(),FV(),PERIODS(),RATE()
* $END$
/* $DOC$
$FUNCNAME$
PAYMENT()
$CATEGORY$
CT3 math functions
$ONELINER$
Payments for a loan
$SYNTAX$
PAYMENT( nLoan, nInterest, nPeriods ) --> nPayment
$ARGUMENTS$
<nLoan> amount of money you get from the bank
<nInterest> rate of interest per period, 1 == 100%
<nPeriods> period count
$RETURNS$
<nPayment> Periodical payment one has to make to pay the
loan <nLoan> back
$DESCRIPTION$
PAYMENT() calculates the payment one has to make periodically
to pay back a loan <nLoan> within <nPeriods> periods and for a
rate of interest <nInterest> per period.
debt in period 0 = <nLoan>
debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100)
debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100)
etc...
debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100)
-> has to be 0, so
<nPayment> = <nLoan>*(<nInterest>/100)/(1-(1+<nInterest>/100)^(-n))
$EXAMPLES$
// You get a loan of 5172.56 at a interest rate of 0.5% per
// month (6% per year).
// For 5 years, you have to pay back every month
? payment( 5172.56, 0.005, 60 ) // --> 100.00
$TESTS$
payment( 5172.56, 0.0, 60 ) == 86.21
payment( 5172.56, 0.005, 60 ) == 100.00
$STATUS$
Ready
$COMPLIANCE$
PAYMENT() is compatible with CT3's PAYMENT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
PV(),FV(),PERIODS(),RATE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* PERIODS()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Number of periods for a loan
* $SYNTAX$
* PERIODS( nLoan, nPayment, nInterest ) --> nPeriods
* $ARGUMENTS$
* <nLoan> amount of money you get from the bank
* <nPayment> amount of money you pay back per period
* <nInterest> rate of interest per period, 1 == 100%
* $RETURNS$
* <nPeriods> number of periods you need to pay the loan back
* $DESCRIPTION$
* PERIODS() calculates the number of periods one needs to pay back
* a loan of <nLoan> with periodical payments of <nPayment> and for a
* rate of interest <nInterest> per period.
* debt in period 0 = <nLoan>
* debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100)
* debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100)
* etc...
* debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100)
* -> has to be 0, so
* <nPeriods> = -log(1-<nLoan>*(<nInterest>/100)/<nPayment>)/log(1+<nInterest>/100))
*
* Note, however that in the case of nPayment <= <nLoan>*(<nInterest>/100),
* one would need infinite time to pay the loan back. The functions does
* then return -1.
* $EXAMPLES$
* // You get a loan of 5172.56 at a interest rate of 0.5% per
* // month (6% per year).
* // You can afford to pay 100 back every month, so you need
*
* ? periods( 5172.56, 100, 0.005 ) // --> 60.0
*
* // months to cancel the loan.
* $TESTS$
* periods( 5172.56, 100, 0.005 ) == 60.0
* periods( 5172.56, 100, 0.0 ) == 51.7256
* $STATUS$
* Ready
* $COMPLIANCE$
* PERIODS() is compatible with CT3's PERIODS().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* PV(),FV(),PAYMENT(),RATE()
* $END$
/* $DOC$
$FUNCNAME$
PERIODS()
$CATEGORY$
CT3 math functions
$ONELINER$
Number of periods for a loan
$SYNTAX$
PERIODS( nLoan, nPayment, nInterest ) --> nPeriods
$ARGUMENTS$
<nLoan> amount of money you get from the bank
<nPayment> amount of money you pay back per period
<nInterest> rate of interest per period, 1 == 100%
$RETURNS$
<nPeriods> number of periods you need to pay the loan back
$DESCRIPTION$
PERIODS() calculates the number of periods one needs to pay back
a loan of <nLoan> with periodical payments of <nPayment> and for a
rate of interest <nInterest> per period.
debt in period 0 = <nLoan>
debt in period 1 = ((debt in period 0)-<nPayment>)*(1+<nInterest>/100)
debt in period 2 = ((debt in period 1)-<nPayment>)*(1+<nInterest>/100)
etc...
debt in period <nPeriod> = ((debt in period <nPeriod>-1)-<nPayment>)*(1+<nInterest>/100)
-> has to be 0, so
<nPeriods> = -log(1-<nLoan>*(<nInterest>/100)/<nPayment>)/log(1+<nInterest>/100))
Note, however that in the case of nPayment <= <nLoan>*(<nInterest>/100),
one would need infinite time to pay the loan back. The functions does
then return -1.
$EXAMPLES$
// You get a loan of 5172.56 at a interest rate of 0.5% per
// month (6% per year).
// You can afford to pay 100 back every month, so you need
? periods( 5172.56, 100, 0.005 ) // --> 60.0
// months to cancel the loan.
$TESTS$
periods( 5172.56, 100, 0.005 ) == 60.0
periods( 5172.56, 100, 0.0 ) == 51.7256
$STATUS$
Ready
$COMPLIANCE$
PERIODS() is compatible with CT3's PERIODS().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
PV(),FV(),PAYMENT(),RATE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* RATE()
* $CATEGORY$
* CT3 math functions
* $ONELINER$
* Estimate rate of interest for a loan
* $SYNTAX$
* RATE( nLoan, nPayment, nPeriods ) --> nRate
* $ARGUMENTS$
* <nLoan> amount of money you get from the bank
* <nPayment> amount of money you pay back per period
* <nPeriods> number of periods you pay the loan back
* $RETURNS$
* <nInterest> estimated rate of interest per period, 1 == 100%
* $DESCRIPTION$
* RATE() calculates the rate of interest per period for the given
* loan, payment per periods and number of periods. This is done with
* the same equation used in the PAYMENT() or PERIODS() function:
*
* <nPayment> = <nLoan>*(<nInterest>/100)/(1-(1+<nInterest>/100)^(-<nPeriods>))
*
* However, this equation can not be solved for <nInterest> in a "closed"
* manner, i.e. <nInterest> = ..., so that the result can only be estimated.
* $EXAMPLES$
* // You get a loan of 5172.56, pay 100 back every month for
* // 5 years (60 months). The effective interest rate per
* // period (=month) is
*
* ? rate( 5172.56, 100, 60 ) // --> 0.005
*
* $TESTS$
* rate( 5172.56, 100, 60.0 ) == 0.005
* rate( 6000.0, 100, 60.0 ) == 0.0
* $STATUS$
* Ready
* $COMPLIANCE$
* RATE() is compatible with CT3's RATE().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* PV(),FV(),PAYMENT(),PERIODS()
* $END$
/* $DOC$
$FUNCNAME$
RATE()
$CATEGORY$
CT3 math functions
$ONELINER$
Estimate rate of interest for a loan
$SYNTAX$
RATE( nLoan, nPayment, nPeriods ) --> nRate
$ARGUMENTS$
<nLoan> amount of money you get from the bank
<nPayment> amount of money you pay back per period
<nPeriods> number of periods you pay the loan back
$RETURNS$
<nInterest> estimated rate of interest per period, 1 == 100%
$DESCRIPTION$
RATE() calculates the rate of interest per period for the given
loan, payment per periods and number of periods. This is done with
the same equation used in the PAYMENT() or PERIODS() function:
<nPayment> = <nLoan>*(<nInterest>/100)/(1-(1+<nInterest>/100)^(-<nPeriods>))
However, this equation can not be solved for <nInterest> in a "closed"
manner, i.e. <nInterest> = ..., so that the result can only be estimated.
$EXAMPLES$
// You get a loan of 5172.56, pay 100 back every month for
// 5 years (60 months). The effective interest rate per
// period (=month) is
? rate( 5172.56, 100, 60 ) // --> 0.005
$TESTS$
rate( 5172.56, 100, 60.0 ) == 0.005
rate( 6000.0, 100, 60.0 ) == 0.0
$STATUS$
Ready
$COMPLIANCE$
RATE() is compatible with CT3's RATE().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
PV(),FV(),PAYMENT(),PERIODS()
$END$
*/

View File

@@ -2,85 +2,85 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FTOC()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
*
* $SYNTAX$
* FTOC( <nFloatingPointNumber> ) --> cFloatingPointNumber
*
* $ARGUMENTS$
* <nFloatingPointNumber> Designate any Harbour number.
*
* $RETURNS$
* FTOC() return a string with the size of DOUBLE.
* ATTENTION: different implementations or platforms of Harbour, they
* could produce different format in the string returned by FTOC().
*
* $DESCRIPTION$
* Harbour internal numbers in Floating Point are stored in data type
* DOUBLE. FTOC() returns these bits as an string. In this way,
* numbers con be saved more compactly.
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTOF(), XTOC()
* $END$
/* $DOC$
$FUNCNAME$
FTOC()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
$SYNTAX$
FTOC( <nFloatingPointNumber> ) --> cFloatingPointNumber
$ARGUMENTS$
<nFloatingPointNumber> Designate any Harbour number.
$RETURNS$
FTOC() return a string with the size of DOUBLE.
ATTENTION: different implementations or platforms of Harbour, they
could produce different format in the string returned by FTOC().
$DESCRIPTION$
Harbour internal numbers in Floating Point are stored in data type
DOUBLE. FTOC() returns these bits as an string. In this way,
numbers con be saved more compactly.
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTOF(), XTOC()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTOF()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
*
* $SYNTAX$
* CTOF( <cFloatingPointNumber> ) --> nFloatingPointNumber
*
* $ARGUMENTS$
* <cFloatingPointNumber> Designate a string that contains a Harbour
* number in flotaing point format.
* ATTENTION: different implementations or platforms of Harbour, they
* could produce different format in the string returned by FTOC().
*
* $RETURNS$
* CTOF() return the floating point number that corresponds to the
* string passed.
*
* $DESCRIPTION$
* Character strings created with FTOC() or XTOC() are convert into
* Harbour floating point number
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* FTOC(), XTOC()
* $END$
/* $DOC$
$FUNCNAME$
CTOF()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
$SYNTAX$
CTOF( <cFloatingPointNumber> ) --> nFloatingPointNumber
$ARGUMENTS$
<cFloatingPointNumber> Designate a string that contains a Harbour
number in flotaing point format.
ATTENTION: different implementations or platforms of Harbour, they
could produce different format in the string returned by FTOC().
$RETURNS$
CTOF() return the floating point number that corresponds to the
string passed.
$DESCRIPTION$
Character strings created with FTOC() or XTOC() are convert into
Harbour floating point number
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
FTOC(), XTOC()
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* JUSTLEFT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Move characters from the beginning to the end of a string
* $SYNTAX$
* JUSTLEFT( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* JUSTLEFT() is compatible with CT3's JUSTLEFT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* JUSTRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
JUSTLEFT()
$CATEGORY$
CT3 string functions
$ONELINER$
Move characters from the beginning to the end of a string
$SYNTAX$
JUSTLEFT( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
JUSTLEFT() is compatible with CT3's JUSTLEFT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
JUSTRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* JUSTRIGHT()
* $CATEGORY$
* Harbour Tools string functions
* $ONELINER$
* Move characters from the end to the beginning of a string
* $SYNTAX$
* JUSTRIGHT( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* JUSTRIGHT() is compatible with CT3's JUSTRIGHT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* JUSTLEFT()
* $END$
/* $DOC$
$FUNCNAME$
JUSTRIGHT()
$CATEGORY$
Harbour Tools string functions
$ONELINER$
Move characters from the end to the beginning of a string
$SYNTAX$
JUSTRIGHT( <[@]cString>, [<cChar>|<nChar>] ) -> cJustifiedString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
JUSTRIGHT() is compatible with CT3's JUSTRIGHT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
JUSTLEFT()
$END$
*/

View File

@@ -2,130 +2,130 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* KSETINS()
* $CATEGORY$
* CT3 switch and state functions
* $ONELINER$
*
* $SYNTAX$
* KSETINS( [<lNewSwitch>] ) -> lOldSwitch
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* DOS
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
KSETINS()
$CATEGORY$
CT3 switch and state functions
$ONELINER$
$SYNTAX$
KSETINS( [<lNewSwitch>] ) -> lOldSwitch
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
DOS
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* KSETCAPS()
* $CATEGORY$
* CT3 switch and state functions
* $ONELINER$
*
* $SYNTAX$
* KSETCAPS( [<lNewSwitch>] ) -> lOldSwitch
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* DOS
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
KSETCAPS()
$CATEGORY$
CT3 switch and state functions
$ONELINER$
$SYNTAX$
KSETCAPS( [<lNewSwitch>] ) -> lOldSwitch
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
DOS
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* KSETNUM()
* $CATEGORY$
* CT3 switch and state functions
* $ONELINER$
*
* $SYNTAX$
* KSETNUM( [<lNewSwitch>] ) -> lOldSwitch
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* DOS
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
KSETNUM()
$CATEGORY$
CT3 switch and state functions
$ONELINER$
$SYNTAX$
KSETNUM( [<lNewSwitch>] ) -> lOldSwitch
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
DOS
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* KSETSCROLL()
* $CATEGORY$
* CT3 switch and state functions
* $ONELINER$
*
* $SYNTAX$
* KSETSCROLL( [<lNewSwitch>] ) -> lOldSwitch
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* DOS
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
KSETSCROLL()
$CATEGORY$
CT3 switch and state functions
$ONELINER$
$SYNTAX$
KSETSCROLL( [<lNewSwitch>] ) -> lOldSwitch
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
DOS
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,50 +2,50 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* XTOC()
* $CATEGORY$
* CT3 miscellaneous functions
* $ONELINER$
*
* $SYNTAX$
* XTOC( <expValue> ) --> cValue
*
* $ARGUMENTS$
* <expValue> Designate an expression of some of the following data
* type: NUMBER, CHARACTER, DATE, LOGICAL.
*
* $RETURNS$
* XTOC() return a string with the representation of data type of
* expValue.
*
* $DESCRIPTION$
* Each data type always returns a string with a particular fixed length:
*
* -----------------------------------------------------------
* Data Type Result Length Similar function
* -----------------------------------------------------------
* Numeric sizeof( DOUBLE ) FTOC()
* Logical 1
* Date 8 DTOS()
* String Unchanged
* -----------------------------------------------------------
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTOF(), FTOC()
* $END$
/* $DOC$
$FUNCNAME$
XTOC()
$CATEGORY$
CT3 miscellaneous functions
$ONELINER$
$SYNTAX$
XTOC( <expValue> ) --> cValue
$ARGUMENTS$
<expValue> Designate an expression of some of the following data
type: NUMBER, CHARACTER, DATE, LOGICAL.
$RETURNS$
XTOC() return a string with the representation of data type of
expValue.
$DESCRIPTION$
Each data type always returns a string with a particular fixed length:
-----------------------------------------------------------
Data Type Result Length Similar function
-----------------------------------------------------------
Numeric sizeof( DOUBLE ) FTOC()
Logical 1
Date 8 DTOS()
String Unchanged
-----------------------------------------------------------
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTOF(), FTOC()
$END$
*/

View File

@@ -2,114 +2,114 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CELSIUS()
* $CATEGORY$
* CT3 numeric functions
* $ONELINER$
* Temperature conversion Fahrenheit to Celsius
* $SYNTAX$
* CELSIUS( nDegreeFahrenheit ) --> nDegreeCelsius
* $ARGUMENTS$
* <nDegreeFahrenheit> temperature in degree Fahrenheit
* $RETURNS$
* <nDegreeCelsius> temperate in degree Celsius
* $DESCRIPTION$
* CELSIUS() converts temperature values measured in the Fahrenheit scale
* to the Celsius scale.
* $EXAMPLES$
* // melting point of water in standard conditions
* ? celsius( 32.0 ) // --> 0.0
* // boiling point of water in standard conditions
* ? celsius( 212.0 ) // --> 100.0
* $TESTS$
* celsius( 32.0 ) == 0.0
* celsius( 212.0 ) == 100.0
* $STATUS$
* Ready
* $COMPLIANCE$
* CELSIUS() is compatible with CT3's CELSIUS().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* FAHRENHEIT()
* $END$
/* $DOC$
$FUNCNAME$
CELSIUS()
$CATEGORY$
CT3 numeric functions
$ONELINER$
Temperature conversion Fahrenheit to Celsius
$SYNTAX$
CELSIUS( nDegreeFahrenheit ) --> nDegreeCelsius
$ARGUMENTS$
<nDegreeFahrenheit> temperature in degree Fahrenheit
$RETURNS$
<nDegreeCelsius> temperate in degree Celsius
$DESCRIPTION$
CELSIUS() converts temperature values measured in the Fahrenheit scale
to the Celsius scale.
$EXAMPLES$
// melting point of water in standard conditions
? celsius( 32.0 ) // --> 0.0
// boiling point of water in standard conditions
? celsius( 212.0 ) // --> 100.0
$TESTS$
celsius( 32.0 ) == 0.0
celsius( 212.0 ) == 100.0
$STATUS$
Ready
$COMPLIANCE$
CELSIUS() is compatible with CT3's CELSIUS().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
FAHRENHEIT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* FAHRENHEIT()
* $CATEGORY$
* CT3 numeric functions
* $ONELINER$
* Temperature conversion Celsius to Fahrenheit
* $SYNTAX$
* FAHRENHEIT( nDegreeCelsius ) --> nDegreeFahrenheit
* $ARGUMENTS$
* <nDegreeCelsius> temperate in degree Celsius
* $RETURNS$
* <nDegreeFahrenheit> temperature in degree Fahrenheit
* $DESCRIPTION$
* FAHRENHEIT() converts temperature values measured in the Celsius scale
* to the Fahrenheit scale.
* $EXAMPLES$
* // melting point of water in standard conditions
* ? fahrenheit( 0.0 ) // --> 32.0
* // boiling point of water in standard conditions
* ? fahrenheit( 100.0 ) // --> 212.0
* $TESTS$
* fahrenheit( 0.0 ) == 32.0
* celsius( 100.0 ) == 212.0
* $STATUS$
* Ready
* $COMPLIANCE$
* FAHRENHEIT() is compatible with CT3's FAHRENHEIT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CELSIUS()
* $END$
/* $DOC$
$FUNCNAME$
FAHRENHEIT()
$CATEGORY$
CT3 numeric functions
$ONELINER$
Temperature conversion Celsius to Fahrenheit
$SYNTAX$
FAHRENHEIT( nDegreeCelsius ) --> nDegreeFahrenheit
$ARGUMENTS$
<nDegreeCelsius> temperate in degree Celsius
$RETURNS$
<nDegreeFahrenheit> temperature in degree Fahrenheit
$DESCRIPTION$
FAHRENHEIT() converts temperature values measured in the Celsius scale
to the Fahrenheit scale.
$EXAMPLES$
// melting point of water in standard conditions
? fahrenheit( 0.0 ) // --> 32.0
// boiling point of water in standard conditions
? fahrenheit( 100.0 ) // --> 212.0
$TESTS$
fahrenheit( 0.0 ) == 32.0
celsius( 100.0 ) == 212.0
$STATUS$
Ready
$COMPLIANCE$
FAHRENHEIT() is compatible with CT3's FAHRENHEIT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CELSIUS()
$END$
*/
/* $DOC$
* $FUNCNAME$
* INFINITY()
* $CATEGORY$
* CT3 numeric functions
* $ONELINER$
* Returns the largest floating point number available in the system
* $SYNTAX$
* INFINITY( [<lPlatformIndependant>] ) --> nLargestNumber
* $ARGUMENTS$
* [<lPlatformIndependant>] .T., if the function should return
* the maximum floating point value
* available (DBL_MAX)
* .F., function should try to return
* the same value as the original CT3 lib did
* Default: .F.
* $RETURNS$
* <nLargestNumber> the largest floating point number available in the system
* $DESCRIPTION$
* INFINITY() returns the largest floating point number available
* in the system. For platform independance, this is set to DBL_MAX.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* INFINITY() must not necessarily return the same number as CT3's INFINITY().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
INFINITY()
$CATEGORY$
CT3 numeric functions
$ONELINER$
Returns the largest floating point number available in the system
$SYNTAX$
INFINITY( [<lPlatformIndependant>] ) --> nLargestNumber
$ARGUMENTS$
[<lPlatformIndependant>] .T., if the function should return
the maximum floating point value
available (DBL_MAX)
.F., function should try to return
the same value as the original CT3 lib did
Default: .F.
$RETURNS$
<nLargestNumber> the largest floating point number available in the system
$DESCRIPTION$
INFINITY() returns the largest floating point number available
in the system. For platform independance, this is set to DBL_MAX.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
INFINITY() must not necessarily return the same number as CT3's INFINITY().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,34 +2,34 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* NUMAT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Number of occurrences of a sequence in a string
* $SYNTAX$
* NUMAT( <cStringToMatch>, <cString>, [<nIgnore>] ) --> nCount
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* NUMAT() is compatible with CT3's NUMAT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CSETATMUPA(),SETATLIKE()
* $END$
/* $DOC$
$FUNCNAME$
NUMAT()
$CATEGORY$
CT3 string functions
$ONELINER$
Number of occurrences of a sequence in a string
$SYNTAX$
NUMAT( <cStringToMatch>, <cString>, [<nIgnore>] ) --> nCount
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
NUMAT() is compatible with CT3's NUMAT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CSETATMUPA(),SETATLIKE()
$END$
*/

View File

@@ -2,130 +2,130 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* NTOC()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
*
* $SYNTAX$
* NTOC( <xNumber>[, <nBase>][,<nLength>][,<cPadChar>] ) -> <cNumber>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTON()
* $END$
/* $DOC$
$FUNCNAME$
NTOC()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
$SYNTAX$
NTOC( <xNumber>[, <nBase>][,<nLength>][,<cPadChar>] ) -> <cNumber>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTON()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTON()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
*
* $SYNTAX$
* CTON( <xNumber>[, <nBase>][,<lMode>] ) -> <nNumber>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* NTOC()
* $END$
/* $DOC$
$FUNCNAME$
CTON()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
$SYNTAX$
CTON( <xNumber>[, <nBase>][,<lMode>] ) -> <nNumber>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
NTOC()
$END$
*/
/* $DOC$
* $FUNCNAME$
* BITTOC()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
*
* $SYNTAX$
* BITTOC( <nInteger>, <cBitPattern>[,<lMode>] ) -> <cBitString>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CTOBIT()
* $END$
/* $DOC$
$FUNCNAME$
BITTOC()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
$SYNTAX$
BITTOC( <nInteger>, <cBitPattern>[,<lMode>] ) -> <cBitString>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CTOBIT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CTOBIT()
* $CATEGORY$
* CT3 number and bit manipulation functions
* $ONELINER$
*
* $SYNTAX$
* CTOBIT( <cBitString>, <cBitPattern> ) -> <nWord>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* BITTOC()
* $END$
/* $DOC$
$FUNCNAME$
CTOBIT()
$CATEGORY$
CT3 number and bit manipulation functions
$ONELINER$
$SYNTAX$
CTOBIT( <cBitString>, <cBitPattern> ) -> <nWord>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
BITTOC()
$END$
*/

View File

@@ -2,131 +2,131 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* POSALPHA()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Left-most position of a letter in a string
* $SYNTAX$
* POSALPHA( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSALPHA() is compatible with CT3's POSALPHA().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSLOWER(),POSUPPER(),POSRANGE()
* $END$
/* $DOC$
$FUNCNAME$
POSALPHA()
$CATEGORY$
CT3 string functions
$ONELINER$
Left-most position of a letter in a string
$SYNTAX$
POSALPHA( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSALPHA() is compatible with CT3's POSALPHA().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSLOWER(),POSUPPER(),POSRANGE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSLOWER()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Left-most position of a lowercase letter in a string
* $SYNTAX$
* POSLOWER( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSLOWER() is compatible with CT3's POSLOWER().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSALPHA(),POSUPPER(),POSRANGE()
* $END$
/* $DOC$
$FUNCNAME$
POSLOWER()
$CATEGORY$
CT3 string functions
$ONELINER$
Left-most position of a lowercase letter in a string
$SYNTAX$
POSLOWER( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSLOWER() is compatible with CT3's POSLOWER().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSALPHA(),POSUPPER(),POSRANGE()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSRANGE()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Left-most position of a character from a set in a string
* $SYNTAX$
* POSRANGE( <cChar1>, <cChar2>, <cString>, [<lMode>],
* [<nIgnore>] ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSRANGE() is compatible with CT3's POSRANGE().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSALPHA(),POSLOWER(),POSUPPER()
* $END$
/* $DOC$
$FUNCNAME$
POSRANGE()
$CATEGORY$
CT3 string functions
$ONELINER$
Left-most position of a character from a set in a string
$SYNTAX$
POSRANGE( <cChar1>, <cChar2>, <cString>, [<lMode>],
[<nIgnore>] ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSRANGE() is compatible with CT3's POSRANGE().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSALPHA(),POSLOWER(),POSUPPER()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSUPPER()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Left-most position of an uppercase letter in a string
* $SYNTAX$
* POSUPPER( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSUPPER() is compatible with CT3's POSUPPER().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSALPHA(),POSLOWER(),POSRANGE()
* $END$
/* $DOC$
$FUNCNAME$
POSUPPER()
$CATEGORY$
CT3 string functions
$ONELINER$
Left-most position of an uppercase letter in a string
$SYNTAX$
POSUPPER( <cString>, [<lMode>], [<nIgnore>] ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSUPPER() is compatible with CT3's POSUPPER().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSALPHA(),POSLOWER(),POSRANGE()
$END$
*/

View File

@@ -2,130 +2,130 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* POSCHAR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace character at a certain position within a string
* $SYNTAX$
* POSCHAR( <[@]cString>, <cCharacter|nCharacter>, [<nPosition>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSCHAR() is compatible with CT3's POSCHAR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSDEL(),POSINS(),POSREPL(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
POSCHAR()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace character at a certain position within a string
$SYNTAX$
POSCHAR( <[@]cString>, <cCharacter|nCharacter>, [<nPosition>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSCHAR() is compatible with CT3's POSCHAR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSDEL(),POSINS(),POSREPL(),CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSDEL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Delete characters at a certain position within a string
* $SYNTAX$
* POSDEL( <cString>, [<nStartPosition>], <nLength> ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSDEL() is compatible with CT3's POSDEL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSCHAR(),POSINS(),POSREPL()
* $END$
/* $DOC$
$FUNCNAME$
POSDEL()
$CATEGORY$
CT3 string functions
$ONELINER$
Delete characters at a certain position within a string
$SYNTAX$
POSDEL( <cString>, [<nStartPosition>], <nLength> ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSDEL() is compatible with CT3's POSDEL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSCHAR(),POSINS(),POSREPL()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSINS()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Insert characters at a certain position within a string
* $SYNTAX$
* POSINS( <cString>, <cInsert>, [<nPosition>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSINS() is compatible with CT3's POSINS().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSCHAR,POSDEL(),POSREPL()
* $END$
/* $DOC$
$FUNCNAME$
POSINS()
$CATEGORY$
CT3 string functions
$ONELINER$
Insert characters at a certain position within a string
$SYNTAX$
POSINS( <cString>, <cInsert>, [<nPosition>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSINS() is compatible with CT3's POSINS().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSCHAR,POSDEL(),POSREPL()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSREPL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace characters at a certain position within a string
* $SYNTAX$
* POSREPL( <[@]cString>, <cReplacement>, [<nStartPosition>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSREPL() is compatible with CT3's POSREPL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSCHAR(),POSDEL(),POSINS(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
POSREPL()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace characters at a certain position within a string
$SYNTAX$
POSREPL( <[@]cString>, <cReplacement>, [<nStartPosition>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSREPL() is compatible with CT3's POSREPL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSCHAR(),POSDEL(),POSINS(),CSETREF()
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* POSDIFF()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* The left-most position there two string differ
* $SYNTAX$
* POSDIFF( <cString1>, <cString2>, [<nIgnore>] ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSDIFF() is compatible with CT3's POSDIFF().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSEQUAL()
* $END$
/* $DOC$
$FUNCNAME$
POSDIFF()
$CATEGORY$
CT3 string functions
$ONELINER$
The left-most position there two string differ
$SYNTAX$
POSDIFF( <cString1>, <cString2>, [<nIgnore>] ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSDIFF() is compatible with CT3's POSDIFF().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSEQUAL()
$END$
*/
/* $DOC$
* $FUNCNAME$
* POSEQUAL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* The left-most position there two string begin to be equal
* $SYNTAX$
* POSEQUAL( <cString1>, <cString2>, [<nCompare>], [<nIgnore>] ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* POSEQUAL() is compatible with CT3's POSEQUAL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* POSDIFF()
* $END$
/* $DOC$
$FUNCNAME$
POSEQUAL()
$CATEGORY$
CT3 string functions
$ONELINER$
The left-most position there two string begin to be equal
$SYNTAX$
POSEQUAL( <cString1>, <cString2>, [<nCompare>], [<nIgnore>] ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
POSEQUAL() is compatible with CT3's POSEQUAL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
POSDIFF()
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* PRINTSTAT()
* $CATEGORY$
* CT3 printer functions
* $ONELINER$
*
* $SYNTAX$
* PRINTSTAT( [<nPrinter>] ) -> nState
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* DOS
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
PRINTSTAT()
$CATEGORY$
CT3 printer functions
$ONELINER$
$SYNTAX$
PRINTSTAT( [<nPrinter>] ) -> nState
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
DOS
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* PRINTREADY()
* $CATEGORY$
* CT3 printer functions
* $ONELINER$
*
* $SYNTAX$
* PRINTREADY( [<nPrinter>] ) -> lPrinterReady
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* DOS
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
PRINTREADY()
$CATEGORY$
CT3 printer functions
$ONELINER$
$SYNTAX$
PRINTREADY( [<nPrinter>] ) -> lPrinterReady
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
DOS
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,77 +2,77 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* RANGEREM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Remove characters within a certain ASCII range from a string
* $SYNTAX$
* RANGEREM( <cChar1|nChar1>, <cChar2|nChar2>, <cString> ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
* ? rangerem( "0", "9", "year2002.dbf" ) // "year.dbf", remove all digits
* ? rangerem( "9", "0", "year2002.dbf" ) // "22", testing removal from "9" to Chr(255)
* // and from Chr(0) to "0"
* ? rangerem( "0", "9", "yearcurr.dbf" ) // "yearcurr.dbf", test leaving string untouched
* $TESTS$
* rangerem( "0", "9", "year2002.dbf" ) == "year.dbf"
* rangerem( "9", "0", "year2002.dbf" ) == "22"
* rangerem( "0", "9", "yearcurr.dbf" ) == "yearcurr.dbf"
* $STATUS$
* Started
* $COMPLIANCE$
* RANGEREM() is compatible with CT3's RANGEREM().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* RANGEREPL()
* $END$
/* $DOC$
$FUNCNAME$
RANGEREM()
$CATEGORY$
CT3 string functions
$ONELINER$
Remove characters within a certain ASCII range from a string
$SYNTAX$
RANGEREM( <cChar1|nChar1>, <cChar2|nChar2>, <cString> ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
? rangerem( "0", "9", "year2002.dbf" ) // "year.dbf", remove all digits
? rangerem( "9", "0", "year2002.dbf" ) // "22", testing removal from "9" to Chr(255)
// and from Chr(0) to "0"
? rangerem( "0", "9", "yearcurr.dbf" ) // "yearcurr.dbf", test leaving string untouched
$TESTS$
rangerem( "0", "9", "year2002.dbf" ) == "year.dbf"
rangerem( "9", "0", "year2002.dbf" ) == "22"
rangerem( "0", "9", "yearcurr.dbf" ) == "yearcurr.dbf"
$STATUS$
Started
$COMPLIANCE$
RANGEREM() is compatible with CT3's RANGEREM().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
RANGEREPL()
$END$
*/
/* $DOC$
* $FUNCNAME$
* RANGEREPL
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace characters within a certain ASCII range from a string
* $SYNTAX$
* RANGEREPL( <cChar1|nChar1>, <cChar2|nChar2>,
* <[@]cString>, <cReplacementChar|nReplacementChar> ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
* ? rangerepl( "0", "9", "year2002.dbf", "?" ) // "year????.dbf", replace all digits
* ? rangerepl( "9", "0", "year2002.dbf", "?" ) // "????2??2????", testing replacement from "9" to Chr(255)
* // and from Chr(0) to "0"
* ? rangerepl( "0", "9", "yearcurr.dbf", "?" ) // "yearcurr.dbf", test leaving string untouched
* $TESTS$
* rangerepl( "0", "9", "year2002.dbf", "?" ) == "year????.dbf"
* rangerepl( "9", "0", "year2002.dbf", "?" ) == "????2??2????"
* rangerepl( "0", "9", "yearcurr.dbf", "?" ) == "yearcurr.dbf"
* $STATUS$
* Started
* $COMPLIANCE$
* RANGEREPL() is compatible with CT3's RANGEREPL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* RANGEREM()
* $END$
/* $DOC$
$FUNCNAME$
RANGEREPL
$CATEGORY$
CT3 string functions
$ONELINER$
Replace characters within a certain ASCII range from a string
$SYNTAX$
RANGEREPL( <cChar1|nChar1>, <cChar2|nChar2>,
<[@]cString>, <cReplacementChar|nReplacementChar> ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
? rangerepl( "0", "9", "year2002.dbf", "?" ) // "year????.dbf", replace all digits
? rangerepl( "9", "0", "year2002.dbf", "?" ) // "????2??2????", testing replacement from "9" to Chr(255)
// and from Chr(0) to "0"
? rangerepl( "0", "9", "yearcurr.dbf", "?" ) // "yearcurr.dbf", test leaving string untouched
$TESTS$
rangerepl( "0", "9", "year2002.dbf", "?" ) == "year????.dbf"
rangerepl( "9", "0", "year2002.dbf", "?" ) == "????2??2????"
rangerepl( "0", "9", "yearcurr.dbf", "?" ) == "yearcurr.dbf"
$STATUS$
Started
$COMPLIANCE$
RANGEREPL() is compatible with CT3's RANGEREPL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
RANGEREM()
$END$
*/

View File

@@ -2,69 +2,69 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARRELA()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Character relation of two strings
* $SYNTAX$
* CHARRELA( <cStringToMatch1>, <cString1>,
* <cStringToMatch2>, <cString2> ) -> nPosition
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* CHARRELA() is compatible with CT3's CHARRELA().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARRELREP()
* $END$
/* $DOC$
$FUNCNAME$
CHARRELA()
$CATEGORY$
CT3 string functions
$ONELINER$
Character relation of two strings
$SYNTAX$
CHARRELA( <cStringToMatch1>, <cString1>,
<cStringToMatch2>, <cString2> ) -> nPosition
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
CHARRELA() is compatible with CT3's CHARRELA().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARRELREP()
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARRELREP()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Relation dependant character replacement
* $SYNTAX$
* CHARRELREP( <cStringToMatch1>, <cString1>,
* <cStringToMatch2>, <[@]cString2>,
* <cReplacement> ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* CHARRELREP() is compatible with CT3's CHARRELREP().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARRELA(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
CHARRELREP()
$CATEGORY$
CT3 string functions
$ONELINER$
Relation dependant character replacement
$SYNTAX$
CHARRELREP( <cStringToMatch1>, <cString1>,
<cStringToMatch2>, <[@]cString2>,
<cReplacement> ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
CHARRELREP() is compatible with CT3's CHARRELREP().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARRELA(),CSETREF()
$END$
*/

View File

@@ -2,98 +2,98 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* REMALL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Remove certain characters at the left and right of a string
* $SYNTAX$
* REMALL( <cString>, [<cSearch|nSearch>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* REMALL() is compatible with CT3's REMALL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* REMLEFT(),REMRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
REMALL()
$CATEGORY$
CT3 string functions
$ONELINER$
Remove certain characters at the left and right of a string
$SYNTAX$
REMALL( <cString>, [<cSearch|nSearch>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
REMALL() is compatible with CT3's REMALL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
REMLEFT(),REMRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* REMLEFT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Remove certain characters at the left of a string
* $SYNTAX$
* REMLEFT( <cString>, [<cSearch|nSearch>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* REMLEFT() is compatible with CT3's REMLEFT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* REMALL(),REMRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
REMLEFT()
$CATEGORY$
CT3 string functions
$ONELINER$
Remove certain characters at the left of a string
$SYNTAX$
REMLEFT( <cString>, [<cSearch|nSearch>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
REMLEFT() is compatible with CT3's REMLEFT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
REMALL(),REMRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* REMRIGHT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Remove certain characters at the right of a string
* $SYNTAX$
* REMRIGHT( <cString>, [<cSearch|nSearch>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* REMRIGHT() is compatible with CT3's REMRIGHT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* REMALL(),REMLEFT()
* $END$
/* $DOC$
$FUNCNAME$
REMRIGHT()
$CATEGORY$
CT3 string functions
$ONELINER$
Remove certain characters at the right of a string
$SYNTAX$
REMRIGHT( <cString>, [<cSearch|nSearch>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
REMRIGHT() is compatible with CT3's REMRIGHT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
REMALL(),REMLEFT()
$END$
*/

View File

@@ -2,98 +2,98 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* REPLALL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace certain characters at the left and right of a string
* $SYNTAX$
* REPLALL( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* REPLALL() is compatible with CT3's REPLALL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* REPLLEFT(),REPLRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
REPLALL()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace certain characters at the left and right of a string
$SYNTAX$
REPLALL( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
REPLALL() is compatible with CT3's REPLALL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
REPLLEFT(),REPLRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* REPLLEFT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace certain characters at the left of a string
* $SYNTAX$
* REPLLEFT( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* REPLLEFT() is compatible with CT3's REPLLEFT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* REPLALL(),REPLRIGHT()
* $END$
/* $DOC$
$FUNCNAME$
REPLLEFT()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace certain characters at the left of a string
$SYNTAX$
REPLLEFT( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
REPLLEFT() is compatible with CT3's REPLLEFT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
REPLALL(),REPLRIGHT()
$END$
*/
/* $DOC$
* $FUNCNAME$
* REPLRIGHT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace certain characters at the right of a string
* $SYNTAX$
* REPLRIGHT( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* REPLRIGHT() is compatible with CT3's REPLRIGHT().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* REPLALL(),REPLLEFT()
* $END$
/* $DOC$
$FUNCNAME$
REPLRIGHT()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace certain characters at the right of a string
$SYNTAX$
REPLRIGHT( <cString>, <cReplace|nReplace>, [<cSearch|nSearch>] ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
REPLRIGHT() is compatible with CT3's REPLRIGHT().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
REPLALL(),REPLLEFT()
$END$
*/

View File

@@ -2,356 +2,356 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* SCREENATTR()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* SCREENATTR( [<nRow>],[<nColumn>] ) -> <nAttr>
* $ARGUMENTS$
* <nRow> Designates the line from which to determine the attribute.
* The default is the cursor line.
*
* <nColumn> Designates the column from which to determine the
* attribute. The default is the cursor column.
*
* $RETURNS$
* SCREENATTR() returns the attribute at the designated position.
*
* $DESCRIPTION$
* SCREENATTR() returns the current screen attribute at <nRow> and
* <nColumn>. You can query targeted attributes this way and save them
* to use later, or process them later with INVERTATTR().
*
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SCREENATTR()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
SCREENATTR( [<nRow>],[<nColumn>] ) -> <nAttr>
$ARGUMENTS$
<nRow> Designates the line from which to determine the attribute.
The default is the cursor line.
<nColumn> Designates the column from which to determine the
attribute. The default is the cursor column.
$RETURNS$
SCREENATTR() returns the attribute at the designated position.
$DESCRIPTION$
SCREENATTR() returns the current screen attribute at <nRow> and
<nColumn>. You can query targeted attributes this way and save them
to use later, or process them later with INVERTATTR().
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* SCREENMIX()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* SCREENMIX( <cCharString>, <cAttributeString>, [<nRow>], [<nCol>] ) -> <cEmptyString>
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SCREENMIX()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
SCREENMIX( <cCharString>, <cAttributeString>, [<nRow>], [<nCol>] ) -> <cEmptyString>
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* SAYSCREEN()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* SAYSCREEN( <cString>, [<nRow>], [<nCol>] ) -> <cEmptyString>
* $ARGUMENTS$
* <cString> - the string to output. Although undocumented, can be NIL.
* <nRow> - row number, defaults to cursor row.
* <nCol> - column number, defaults to cursor column.
* $RETURNS$
* Returns an empty string.
* $DESCRIPTION$
* Outputs a string at specified coordinates without changing character
* attributes.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* SCREENMIX()
* $END$
/* $DOC$
$FUNCNAME$
SAYSCREEN()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
SAYSCREEN( <cString>, [<nRow>], [<nCol>] ) -> <cEmptyString>
$ARGUMENTS$
<cString> - the string to output. Although undocumented, can be NIL.
<nRow> - row number, defaults to cursor row.
<nCol> - column number, defaults to cursor column.
$RETURNS$
Returns an empty string.
$DESCRIPTION$
Outputs a string at specified coordinates without changing character
attributes.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
SCREENMIX()
$END$
*/
/* $DOC$
* $FUNCNAME$
* INVERTWIN()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
*
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* INVERTWIN() is compatible with CT3's INVERTWIN().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
INVERTWIN()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
INVERTWIN() is compatible with CT3's INVERTWIN().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* UNTEXTWIN()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* UNTEXTWIN( <nTopLine>, <nLeftColumn>, <nBottomLine>, <nRightColumn>,
* <cReplacementCharacter|nReplacementCharacter>,
* [<cInitialCharacter|nInitialCharacter>],
* [<cEndCharacter|nEndCharacter>] ) --> cNull
* $ARGUMENTS$
* <nTopLine> Designates the line for the upper-left corner of the
* area.
* <nLeftColumn> Designates the column for the upper-left corner of
* the area.
* <nBottomLine> Designates the line for the bottom-right corner of
* the area.
* <nRightColumn> Designates the line for the bottom-right column of
* the area.
* <cReplacementCharacter|nReplacementCharacter> Replaces each
* character within the window, with the exception of those within the
* range of <cInitialCharacter|nInitialCharacter> and
* <cEndCharacter|nEndCharacter>.
* <cInitialCharacter|nInitialCharacter> Designates the beginning of
* the bracketed area. The character can be number in the range of 0 to
* 255, or the character string type. The default value is 176.
* <cEndCharacter|nEndCharacter> Designates the end of the bracketed
* area. The character can be number in the range of 0 to 255 or the
* character string type. The default value is 223.
* $RETURNS$
* Returns a null string.
* $DESCRIPTION$
* Replaces an area of characters from a region of the screen
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
UNTEXTWIN()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
UNTEXTWIN( <nTopLine>, <nLeftColumn>, <nBottomLine>, <nRightColumn>,
<cReplacementCharacter|nReplacementCharacter>,
[<cInitialCharacter|nInitialCharacter>],
[<cEndCharacter|nEndCharacter>] ) --> cNull
$ARGUMENTS$
<nTopLine> Designates the line for the upper-left corner of the
area.
<nLeftColumn> Designates the column for the upper-left corner of
the area.
<nBottomLine> Designates the line for the bottom-right corner of
the area.
<nRightColumn> Designates the line for the bottom-right column of
the area.
<cReplacementCharacter|nReplacementCharacter> Replaces each
character within the window, with the exception of those within the
range of <cInitialCharacter|nInitialCharacter> and
<cEndCharacter|nEndCharacter>.
<cInitialCharacter|nInitialCharacter> Designates the beginning of
the bracketed area. The character can be number in the range of 0 to
255, or the character string type. The default value is 176.
<cEndCharacter|nEndCharacter> Designates the end of the bracketed
area. The character can be number in the range of 0 to 255 or the
character string type. The default value is 223.
$RETURNS$
Returns a null string.
$DESCRIPTION$
Replaces an area of characters from a region of the screen
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* CHARWIN()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* CHARWIN( <nTop>, <nLeft>, <nBottom>, <nRight>, [<cNewChar|nNewChar>],
* [<cOldChar|nOldChar>] ) --> <cEmptyString>
* $ARGUMENTS$
* <nTop> - top row number, default 0
* <nLeft> - left column number, default 0
* <nBottom> - top row number, default MaxRow()
* <nRight> - right column number, default MaxCol()
* <cNewChar|nNewChar> - new character for the screen area,
* as a numeric value in the range of 0 to
* 255 or as a character string, default value is the CLEARB.
* <cOldChar|nOldChar> - character to exchange. Specify the parameter
* as a numeric in the range of 0 to 255
* or as a character string. The default is to exchange all characters.
* $RETURNS$
* Returns an empty string.
* $DESCRIPTION$
* Exchanges particular characters in a screen area.
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
CHARWIN()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
CHARWIN( <nTop>, <nLeft>, <nBottom>, <nRight>, [<cNewChar|nNewChar>],
[<cOldChar|nOldChar>] ) --> <cEmptyString>
$ARGUMENTS$
<nTop> - top row number, default 0
<nLeft> - left column number, default 0
<nBottom> - top row number, default MaxRow()
<nRight> - right column number, default MaxCol()
<cNewChar|nNewChar> - new character for the screen area,
as a numeric value in the range of 0 to
255 or as a character string, default value is the CLEARB.
<cOldChar|nOldChar> - character to exchange. Specify the parameter
as a numeric in the range of 0 to 255
or as a character string. The default is to exchange all characters.
$RETURNS$
Returns an empty string.
$DESCRIPTION$
Exchanges particular characters in a screen area.
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* COLORWIN()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* COLORWIN( [<nTopLine>], [<nLeftCol>], [<nBottomLine>], [<nRightCol>],
* [<cNewAttr|nNewAttr>], [<cOldAttr|nOldAttr>] ) --> cNull
* $ARGUMENTS$
* <nTopLine> Designates the topmost line to begin processing. The
* default is the cursor line.
* <nLeftCol> Designates the leftmost column to begin processing. The
* default is the cursor column.
* <nBottomLine> Designates the bottommost line that is processed.
* The default is the last screen line or window line.
* <nRightCol> Designates the rightmost column to clear. The default
* is the right screen border or window border.
* <cNewAttr|nNewAttr> Designates the new attribute to replace the old
* one. The default is the standard attribute CLEARA.
* <cOldAttr|nOldAttr> Designates the old character to exchange. The
* default is "exchange all attributes".
* $RETURNS$
* Returns an empty string.
* $DESCRIPTION$
* Exchanges particular attributes in a screen area
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
COLORWIN()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
COLORWIN( [<nTopLine>], [<nLeftCol>], [<nBottomLine>], [<nRightCol>],
[<cNewAttr|nNewAttr>], [<cOldAttr|nOldAttr>] ) --> cNull
$ARGUMENTS$
<nTopLine> Designates the topmost line to begin processing. The
default is the cursor line.
<nLeftCol> Designates the leftmost column to begin processing. The
default is the cursor column.
<nBottomLine> Designates the bottommost line that is processed.
The default is the last screen line or window line.
<nRightCol> Designates the rightmost column to clear. The default
is the right screen border or window border.
<cNewAttr|nNewAttr> Designates the new attribute to replace the old
one. The default is the standard attribute CLEARA.
<cOldAttr|nOldAttr> Designates the old character to exchange. The
default is "exchange all attributes".
$RETURNS$
Returns an empty string.
$DESCRIPTION$
Exchanges particular attributes in a screen area
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* SCREENTEXT()
* $CATEGORY$
* CT video functions (Harbour extension)
* $ONELINER$
*
* $SYNTAX$
* SCREENTEXT( <nTop>, <nLeft>, <nBottom>, <nRight> )
* $ARGUMENTS$
* <nTop> - top row number, default 0
* <nLeft> - left column number, default 0
* <nBottom> - top row number, default MaxRow()
* <nRight> - right column number, default MaxCol()
* $RETURNS$
* Returns string with characters taken from given screen region.
* $DESCRIPTION$
* Returns string with characters taken from given screen region.
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SCREENTEXT()
$CATEGORY$
CT video functions (Harbour extension)
$ONELINER$
$SYNTAX$
SCREENTEXT( <nTop>, <nLeft>, <nBottom>, <nRight> )
$ARGUMENTS$
<nTop> - top row number, default 0
<nLeft> - left column number, default 0
<nBottom> - top row number, default MaxRow()
<nRight> - right column number, default MaxCol()
$RETURNS$
Returns string with characters taken from given screen region.
$DESCRIPTION$
Returns string with characters taken from given screen region.
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* COLORREPL()
* $CATEGORY$
* CT3 video functions
* $ONELINER$
*
* $SYNTAX$
* COLORREPL( [<cNewAttr|nNewAttr>], [<cOldAttr|nOldAttr>] ) --> cNull
* $ARGUMENTS$
* <cNewAttr|nNewAttr> Designates the new attribute. The default is
* CLEARA.
* <cOldAttr|InOldAttr> Designates the old attribute to exchange. The
* default is all existing attributes.
* $RETURNS$
* Returns an empty string.
* $DESCRIPTION$
* Exchanges particular screen attributes
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
*
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
COLORREPL()
$CATEGORY$
CT3 video functions
$ONELINER$
$SYNTAX$
COLORREPL( [<cNewAttr|nNewAttr>], [<cOldAttr|nOldAttr>] ) --> cNull
$ARGUMENTS$
<cNewAttr|nNewAttr> Designates the new attribute. The default is
CLEARA.
<cOldAttr|InOldAttr> Designates the old attribute to exchange. The
default is all existing attributes.
$RETURNS$
Returns an empty string.
$DESCRIPTION$
Exchanges particular screen attributes
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,70 +2,70 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* STRDIFF()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Evaluate the "Edit (Levensthein) Distance" of two strings
* $SYNTAX$
* STRDIFF( <cString1>, <cString2>, [<nReplacementPenalty>], [<nDeletionPenalty>],
* [<nInsertionPenalty>] ) -> <nDistance>
* $ARGUMENTS$
* <cString1> string at the "starting point" of the transformation process, default is ""
* <cString2> string at the "end point" of the transformation process, default is ""
* <nReplacementPenalty> penalty points for a replacement of one character, default is 3
* <nDeletionPenalty> penalty points for a deletion of one character, default is 6
* <nInsertionPenalty> penalty points for an insertion of one character, default is 1
* $RETURNS$
* <nDistance> penalty point sum of all operations needed to transform <cString1> to <cString2>
* $DESCRIPTION$
* The STRDIFF() functions calculates the so called "Edit" or "Levensthein" distance of two strings.
* This distance is a measure for the number of single character replace/insert/delete operations (so called
* "point mutations") required to transform <cString1> into <cString2> and its value will be the smallest sum of
* the penalty points of the required operations.
*
* Be aware that this function is both quite time - O(len(cString1)*len(cString2)) - and memory consuming -
* O((len(cString1)+1)*(len(cString2)+1)*sizeof(int)) - so keep the strings as short as possible.
* E.g., on common 32 bit systems (sizeof(int) == 4), calling strdiff() with two strings of 1024 bytes
* in length will consume 4 MB of memory. To not impose unneeded restrictions, the function will only check if
* (len(cString1)+1)*(len(cString2)+1)*sizeof(int) <= UINT_MAX, although allocing UINT_MAX bytes will not
* work on most systems. If this simple check fails, -1 is returned.
*
* Also, be aware that there can be an overflow when the penalty points are summed up: Assuming that the
* number of transformation operations is in the order of max(len(cString1),len(cString2)), the penalty point
* sum, that is internally stored in an "int" variable, is in the order of
* (max(len(cString1),len(cString2))*max(nReplacementPenalty,nDeletionPenalty,nInsertionPentaly).
* The STRDIFF() does not do an overflow check due to time performance reasons. Future versions of STRDIFF()
* could use a type different to "int" to store the penalty point sum to save memory or to avoid overflows.
*
* The function is aware of the settings done by SETATLIKE(), that means that the wildchar character
* is considered equal to ALL characters.
*
* $EXAMPLES$
* ? strdiff( "ABC", "ADC" ) // 3, one character replaced
* ? strdiff( "ABC", "AEC" ) // 3, dito
* ? strdiff( "CBA", "ABC" ) // 6, two characters replaced
* ? strdiff( "ABC", "AXBC" ) // 1, one character inserted
* ? strdiff( "AXBC", "ABC" ) // 6, one character removed
* ? strdiff( "AXBC", "ADC" ) // 9, one character removed and one replaced
* $TESTS$
* strdiff( "ABC", "ADC" ) == 3
* strdiff( "ABC", "AEC" ) == 3
* strdiff( "CBA", "ABC" ) == 6
* strdiff( "ABC", "AXBC" ) == 1
* strdiff( "AXBC", "ABC" ) == 6
* strdiff( "AXBC", "ADC" ) == 9
* $STATUS$
* Ready
* $COMPLIANCE$
* STRDIFF() is compatible with CT3's STRDIFF().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* SETATLIKE()
* $END$
/* $DOC$
$FUNCNAME$
STRDIFF()
$CATEGORY$
CT3 string functions
$ONELINER$
Evaluate the "Edit (Levensthein) Distance" of two strings
$SYNTAX$
STRDIFF( <cString1>, <cString2>, [<nReplacementPenalty>], [<nDeletionPenalty>],
[<nInsertionPenalty>] ) -> <nDistance>
$ARGUMENTS$
<cString1> string at the "starting point" of the transformation process, default is ""
<cString2> string at the "end point" of the transformation process, default is ""
<nReplacementPenalty> penalty points for a replacement of one character, default is 3
<nDeletionPenalty> penalty points for a deletion of one character, default is 6
<nInsertionPenalty> penalty points for an insertion of one character, default is 1
$RETURNS$
<nDistance> penalty point sum of all operations needed to transform <cString1> to <cString2>
$DESCRIPTION$
The STRDIFF() functions calculates the so called "Edit" or "Levensthein" distance of two strings.
This distance is a measure for the number of single character replace/insert/delete operations (so called
"point mutations") required to transform <cString1> into <cString2> and its value will be the smallest sum of
the penalty points of the required operations.
Be aware that this function is both quite time - O(len(cString1)*len(cString2)) - and memory consuming -
O((len(cString1)+1)*(len(cString2)+1)*sizeof(int)) - so keep the strings as short as possible.
E.g., on common 32 bit systems (sizeof(int) == 4), calling strdiff() with two strings of 1024 bytes
in length will consume 4 MB of memory. To not impose unneeded restrictions, the function will only check if
(len(cString1)+1)*(len(cString2)+1)*sizeof(int) <= UINT_MAX, although allocing UINT_MAX bytes will not
work on most systems. If this simple check fails, -1 is returned.
Also, be aware that there can be an overflow when the penalty points are summed up: Assuming that the
number of transformation operations is in the order of max(len(cString1),len(cString2)), the penalty point
sum, that is internally stored in an "int" variable, is in the order of
(max(len(cString1),len(cString2))*max(nReplacementPenalty,nDeletionPenalty,nInsertionPentaly).
The STRDIFF() does not do an overflow check due to time performance reasons. Future versions of STRDIFF()
could use a type different to "int" to store the penalty point sum to save memory or to avoid overflows.
The function is aware of the settings done by SETATLIKE(), that means that the wildchar character
is considered equal to ALL characters.
$EXAMPLES$
? strdiff( "ABC", "ADC" ) // 3, one character replaced
? strdiff( "ABC", "AEC" ) // 3, dito
? strdiff( "CBA", "ABC" ) // 6, two characters replaced
? strdiff( "ABC", "AXBC" ) // 1, one character inserted
? strdiff( "AXBC", "ABC" ) // 6, one character removed
? strdiff( "AXBC", "ADC" ) // 9, one character removed and one replaced
$TESTS$
strdiff( "ABC", "ADC" ) == 3
strdiff( "ABC", "AEC" ) == 3
strdiff( "CBA", "ABC" ) == 6
strdiff( "ABC", "AXBC" ) == 1
strdiff( "AXBC", "ABC" ) == 6
strdiff( "AXBC", "ADC" ) == 9
$STATUS$
Ready
$COMPLIANCE$
STRDIFF() is compatible with CT3's STRDIFF().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
SETATLIKE()
$END$
*/

View File

@@ -2,34 +2,34 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* STRSWAP()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Swap the contents of two strings
* $SYNTAX$
* STRSWAP( <[@]cString1>, <[@]cString2> ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* STRSWAP() is compatible with CT3's STRSWAP().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
STRSWAP()
$CATEGORY$
CT3 string functions
$ONELINER$
Swap the contents of two strings
$SYNTAX$
STRSWAP( <[@]cString1>, <[@]cString2> ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
STRSWAP() is compatible with CT3's STRSWAP().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,100 +2,100 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* TABEXPAND()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace tabulator control characters with fill characters
* $SYNTAX$
* TABEXPAND (<cString>, [<nTabWidth>], [<cFillChar|nFillChar>],
* [<cNewLineCharacters>], [<cTabChar|nTabChar>],
* [<lIgnore141>]) -> cExpandedString
* $ARGUMENTS$
* <cString>
* <nTabWidth>
* <cFillChar|nFillChar>
* <cNewLineCharacters> string indicating new line,
* default is the string returned by
* hb_eol()
* <cTabChar|nTabChar> character indicating a tab stop,
* default is Chr(9)
* <lIgnore141> .T., if the soft-CR used by MEMOEDIT()
* should be ignored as a newline indicator,
* default is .F. (functions uses Chr(141))
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
* tabexpand("-"+Chr(9)+"!") == "- !"
* tabexpand("----"+Chr(9) +"!") == "---- !"
* tabexpand("-"+Chr(9)+"!",, "+") == "-+++++++!"
* tabexpand("-"+Chr(9)+ "!", 4) == "- !"
* tabexpand("----"+Chr(9)+ "!", 8) == "---- !"
* tabexpand("----"+Chr(9)+ "!", 8, "+") == "----++++!"
* tabexpand("-"+Chr(9)+"!"+hb_eol()+"----"+Chr(9)+ "!",, "+") == "-+++++++!"+hb_eol()+"----++++!"
* $STATUS$
* Started
* $COMPLIANCE$
* TABEXPAND() is compatible with CT3's TABEXPAND(), but there are
* three new parameters for a better fine control of the function's
* behaviour.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TABPACK()
* $END$
/* $DOC$
$FUNCNAME$
TABEXPAND()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace tabulator control characters with fill characters
$SYNTAX$
TABEXPAND (<cString>, [<nTabWidth>], [<cFillChar|nFillChar>],
[<cNewLineCharacters>], [<cTabChar|nTabChar>],
[<lIgnore141>]) -> cExpandedString
$ARGUMENTS$
<cString>
<nTabWidth>
<cFillChar|nFillChar>
<cNewLineCharacters> string indicating new line,
default is the string returned by
hb_eol()
<cTabChar|nTabChar> character indicating a tab stop,
default is Chr(9)
<lIgnore141> .T., if the soft-CR used by MEMOEDIT()
should be ignored as a newline indicator,
default is .F. (functions uses Chr(141))
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
tabexpand("-"+Chr(9)+"!") == "- !"
tabexpand("----"+Chr(9) +"!") == "---- !"
tabexpand("-"+Chr(9)+"!",, "+") == "-+++++++!"
tabexpand("-"+Chr(9)+ "!", 4) == "- !"
tabexpand("----"+Chr(9)+ "!", 8) == "---- !"
tabexpand("----"+Chr(9)+ "!", 8, "+") == "----++++!"
tabexpand("-"+Chr(9)+"!"+hb_eol()+"----"+Chr(9)+ "!",, "+") == "-+++++++!"+hb_eol()+"----++++!"
$STATUS$
Started
$COMPLIANCE$
TABEXPAND() is compatible with CT3's TABEXPAND(), but there are
three new parameters for a better fine control of the function's
behaviour.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TABPACK()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TABPACK()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Pack fill characters to appropriate tab characters
* $SYNTAX$
* TABPACK( <cString>, [<nTabWidth>], [<cFillChar|nFillChar>],
* [<cNewLineCharacters>], [<cTabChar|nTabChar>],
* [<lIgnore141>] ) -> cPackedString
* $ARGUMENTS$
* <cString>
* <nTabWidth>
* <cFillChar|nFillChar>
* <cNewLineCharacters> string indicating new line,
* default is the string returned by
* hb_eol()
* <cTabChar|nTabChar> character indicating a tab stop,
* default is Chr(9)
* <lIgnore141> .T., if the soft-CR used by MEMOEDIT()
* should be ignored as a newline indicator,
* default is .F. (functions uses Chr(141))
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* TABPACK() is compatible with CT3's TABPACK(), but there are
* three new parameters for a better fine control of the function's
* behaviour.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TABEXPAND()
* $END$
/* $DOC$
$FUNCNAME$
TABPACK()
$CATEGORY$
CT3 string functions
$ONELINER$
Pack fill characters to appropriate tab characters
$SYNTAX$
TABPACK( <cString>, [<nTabWidth>], [<cFillChar|nFillChar>],
[<cNewLineCharacters>], [<cTabChar|nTabChar>],
[<lIgnore141>] ) -> cPackedString
$ARGUMENTS$
<cString>
<nTabWidth>
<cFillChar|nFillChar>
<cNewLineCharacters> string indicating new line,
default is the string returned by
hb_eol()
<cTabChar|nTabChar> character indicating a tab stop,
default is Chr(9)
<lIgnore141> .T., if the soft-CR used by MEMOEDIT()
should be ignored as a newline indicator,
default is .F. (functions uses Chr(141))
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
TABPACK() is compatible with CT3's TABPACK(), but there are
three new parameters for a better fine control of the function's
behaviour.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TABEXPAND()
$END$
*/

View File

@@ -2,333 +2,333 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* ATTOKEN()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Position of a token in a string
* $SYNTAX$
* ATTOKEN( <cString>, [<cTokenizer>],
* [<nTokenCount>], [<nSkipWidth>] ) -> nPosition
* $ARGUMENTS$
* <cString> is the processed string
* [<cTokenizer>] is a list of characters separating the tokens
* in <cString>
* Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
* Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
* Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
* ",.;:!\?/\\<>()#&%+-*"
* [<nTokenCount>] specifies the count of the token whose
* position should be calculated
* Default: last token
* [<nSkipWidth>] specifies the maximum number of successive
* tokenizing characters that are combined as
* ONE token stop, e.g. specifying 1 can
* yield to empty tokens
* Default: 0, any number of successive tokenizing
* characters are combined as ONE token stop
* $RETURNS$
* <nPosition> The start position of the specified token or
* 0 if such a token does not exist in <cString>.
* $DESCRIPTION$
* The ATTOKEN() function calculates the start position of tne
* <nTokenCount>th token in <cString>. By setting the new <nSkipWidth>
* parameter to a value different than 0, you can specify how many tokenizing
* characters are combined at most to one token stop. Be aware that
* this can result to empty tokens there the start position is not
* defined clearly. Then, ATTOKEN() returns the position there the
* token WOULD start if its length is larger than 0. To check for
* empty tokens, simply look if the character at the returned position
* is within the tokenizer list.
* $EXAMPLES$
* attoken( "Hello, World!" ) // --> 8 // empty strings after tokenizer
* // are not a token !
* $TESTS$
* attoken( "Hello, World!" ) == 8
* attoken( "Hello, World!",, 2 ) == 8
* attoken( "Hello, World!",, 2, 1 ) == 7
* attoken( "Hello, World!", " ", 2, 1 ) == 8
* $STATUS$
* Ready
* $COMPLIANCE$
* ATTOKEN() is compatible with CT3's ATTOKEN, but has an additional
* 4th parameter to let you specify a skip width equal to that in the
* TOKEN() function.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKEN(),NUMTOKEN(),TOKENLOWER(),TOKENUPPER(),TOKENSEP()
* $END$
/* $DOC$
$FUNCNAME$
ATTOKEN()
$CATEGORY$
CT3 string functions
$ONELINER$
Position of a token in a string
$SYNTAX$
ATTOKEN( <cString>, [<cTokenizer>],
[<nTokenCount>], [<nSkipWidth>] ) -> nPosition
$ARGUMENTS$
<cString> is the processed string
[<cTokenizer>] is a list of characters separating the tokens
in <cString>
Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
",.;:!\?/\\<>()#&%+-*"
[<nTokenCount>] specifies the count of the token whose
position should be calculated
Default: last token
[<nSkipWidth>] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty tokens
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
$RETURNS$
<nPosition> The start position of the specified token or
0 if such a token does not exist in <cString>.
$DESCRIPTION$
The ATTOKEN() function calculates the start position of tne
<nTokenCount>th token in <cString>. By setting the new <nSkipWidth>
parameter to a value different than 0, you can specify how many tokenizing
characters are combined at most to one token stop. Be aware that
this can result to empty tokens there the start position is not
defined clearly. Then, ATTOKEN() returns the position there the
token WOULD start if its length is larger than 0. To check for
empty tokens, simply look if the character at the returned position
is within the tokenizer list.
$EXAMPLES$
attoken( "Hello, World!" ) // --> 8 // empty strings after tokenizer
// are not a token !
$TESTS$
attoken( "Hello, World!" ) == 8
attoken( "Hello, World!",, 2 ) == 8
attoken( "Hello, World!",, 2, 1 ) == 7
attoken( "Hello, World!", " ", 2, 1 ) == 8
$STATUS$
Ready
$COMPLIANCE$
ATTOKEN() is compatible with CT3's ATTOKEN, but has an additional
4th parameter to let you specify a skip width equal to that in the
TOKEN() function.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKEN(),NUMTOKEN(),TOKENLOWER(),TOKENUPPER(),TOKENSEP()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKEN()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Tokens of a string
* $SYNTAX$
* TOKEN( <cString>, [<cTokenizer>],
* [<nTokenCount], [<nSkipWidth>],
* [<@cPreTokenSep>], [<@cPostTokenSep>] ) -> cToken
* $ARGUMENTS$
* <cString> is the processed string
* [<cTokenizer>] is a list of characters separating the tokens
* in <cString>
* Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
* Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
* Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
* ",.;:!\?/\\<>()#&%+-*"
* [<nTokenCount>] specifies the count of the token that
* should be extracted
* Default: last token
* [<nSkipWidth>] specifies the maximum number of successive
* tokenizing characters that are combined as
* ONE token stop, e.g. specifying 1 can
* yield to empty token
* Default: 0, any number of successive tokenizing
* characters are combined as ONE token stop
* [<@cPreTokenSep>] If given by reference, the tokenizer before
* the actual token will be stored
* [<@cPostTokenSep>] If given by reference, the tokenizer after
* the actual token will be stored
* $RETURNS$
* <cToken> the token specified by the parameters given above
* $DESCRIPTION$
* The TOKEN() function extracts the <nTokenCount>th token from the
* string <cString>. In the course of this, the tokens in the
* string are separated by the character(s) specified in <cTokenizer>.
* The function may also extract empty tokens, if you specify a skip
* width other than zero.
* Be aware of the new 5th and 6th parameter there the TOKEN() function
* stores the tokenizing character before and after the extracted token.
* Therefore, additional calls to the TOKENSEP() function are not
* necessary.
* $EXAMPLES$
* ? token( "Hello, World!" ) --> "World"
* ? token( "Hello, World!",, 2, 1 ) --> ""
* ? token( "Hello, World!", ",", 2, 1 ) --> " World!"
* ? token( "Hello, World!", " ", 2, 1 ) --> "World!"
* $TESTS$
* token( "Hello, World!" ) == "World"
* token( "Hello, World!",, 2, 1 ) == ""
* token( "Hello, World!", ",", 2, 1 ) == " World!"
* token( "Hello, World!", " ", 2, 1 ) == "World!"
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKEN() is compatible with CT3's TOKEN, but two additional
* parameters have been added there the TOKEN() function can store
* the tokenizers before and after the current token.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* NUMTOKEN(),ATTOKEN(),TOKENLOWER(),TOKENUPPER(),TOKENSEP()
* $END$
/* $DOC$
$FUNCNAME$
TOKEN()
$CATEGORY$
CT3 string functions
$ONELINER$
Tokens of a string
$SYNTAX$
TOKEN( <cString>, [<cTokenizer>],
[<nTokenCount], [<nSkipWidth>],
[<@cPreTokenSep>], [<@cPostTokenSep>] ) -> cToken
$ARGUMENTS$
<cString> is the processed string
[<cTokenizer>] is a list of characters separating the tokens
in <cString>
Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
",.;:!\?/\\<>()#&%+-*"
[<nTokenCount>] specifies the count of the token that
should be extracted
Default: last token
[<nSkipWidth>] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
[<@cPreTokenSep>] If given by reference, the tokenizer before
the actual token will be stored
[<@cPostTokenSep>] If given by reference, the tokenizer after
the actual token will be stored
$RETURNS$
<cToken> the token specified by the parameters given above
$DESCRIPTION$
The TOKEN() function extracts the <nTokenCount>th token from the
string <cString>. In the course of this, the tokens in the
string are separated by the character(s) specified in <cTokenizer>.
The function may also extract empty tokens, if you specify a skip
width other than zero.
Be aware of the new 5th and 6th parameter there the TOKEN() function
stores the tokenizing character before and after the extracted token.
Therefore, additional calls to the TOKENSEP() function are not
necessary.
$EXAMPLES$
? token( "Hello, World!" ) --> "World"
? token( "Hello, World!",, 2, 1 ) --> ""
? token( "Hello, World!", ",", 2, 1 ) --> " World!"
? token( "Hello, World!", " ", 2, 1 ) --> "World!"
$TESTS$
token( "Hello, World!" ) == "World"
token( "Hello, World!",, 2, 1 ) == ""
token( "Hello, World!", ",", 2, 1 ) == " World!"
token( "Hello, World!", " ", 2, 1 ) == "World!"
$STATUS$
Ready
$COMPLIANCE$
TOKEN() is compatible with CT3's TOKEN, but two additional
parameters have been added there the TOKEN() function can store
the tokenizers before and after the current token.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
NUMTOKEN(),ATTOKEN(),TOKENLOWER(),TOKENUPPER(),TOKENSEP()
$END$
*/
/* $DOC$
* $FUNCNAME$
* NUMTOKEN()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Retrieves the number of tokens in a string
* $SYNTAX$
* NUMTOKEN( <cString>, [<cTokenizer>], [<nSkipWidth>] ) -> nTokenCount
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
*
* $EXAMPLES$
*
* $TESTS$
* numtoken( "Hello, World!" ) == 2
* numtoken( "This is good. See you! How do you do?", ".!?" ) == 3
* numtoken( "one,,three,four,,six", ",", 1 ) == 6
* $STATUS$
* Ready
* $COMPLIANCE$
* NUMTOKEN() is compatible with CT3's NUMTOKEN().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKEN(),ATTOKEN(),TOKENLOWER(),TOKENUPPER(),TOKENSEP()
* $END$
/* $DOC$
$FUNCNAME$
NUMTOKEN()
$CATEGORY$
CT3 string functions
$ONELINER$
Retrieves the number of tokens in a string
$SYNTAX$
NUMTOKEN( <cString>, [<cTokenizer>], [<nSkipWidth>] ) -> nTokenCount
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
$EXAMPLES$
$TESTS$
numtoken( "Hello, World!" ) == 2
numtoken( "This is good. See you! How do you do?", ".!?" ) == 3
numtoken( "one,,three,four,,six", ",", 1 ) == 6
$STATUS$
Ready
$COMPLIANCE$
NUMTOKEN() is compatible with CT3's NUMTOKEN().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKEN(),ATTOKEN(),TOKENLOWER(),TOKENUPPER(),TOKENSEP()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENLOWER()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Change the first letter of tokens to lower case
* $SYNTAX$
* TOKENLOWER( <[@]cString>, [<cTokenizer>], [<nTokenCount>],
* [<nSkipWidth>] ) -> cString
* $ARGUMENTS$
* <[@]cString> is the processed string
* [<cTokenizer>] is a list of characters separating the tokens
* in <cString>
* Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
* Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
* Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
* ",.;:!\?/\\<>()#&%+-*"
* [<nTokenCount>] specifies the number of tokens that
* should be processed
* Default: all tokens
* [<nSkipWidth>] specifies the maximum number of successive
* tokenizing characters that are combined as
* ONE token stop, e.g. specifying 1 can
* yield to empty token
* Default: 0, any number of successive tokenizing
* characters are combined as ONE token stop
* $RETURNS$
* <cString> the string with the lowercased tokens
* $DESCRIPTION$
* The TOKENLOWER() function changes the first letter of tokens in <cString>
* to lower case. To do this, it uses the same tokenizing mechanism
* as the token() function. If TOKENLOWER() extracts a token that starts
* with a letter, this letter will be changed to lower case.
* You can omit the return value of this function by setting the CSETREF()
* switch to .T., but you must then pass <cString> by reference to get
* the result.
* $EXAMPLES$
* ? tokenlower( "Hello, World, here I am!" ) // "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!", " W" ) // "hello, World, here i am!"
* $TESTS$
* tokenlower( "Hello, World, here I am!" ) == "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!", " W" ) == "hello, World, here i am!"
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENLOWER() is compatible with CT3's TOKENLOWER(),
* but a new 4th parameter, <nSkipWidth> has been added for
* synchronization with the the other token functions.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKEN(),NUMTOKEN(),ATTOKEN(),TOKENUPPER(),TOKENSEP(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
TOKENLOWER()
$CATEGORY$
CT3 string functions
$ONELINER$
Change the first letter of tokens to lower case
$SYNTAX$
TOKENLOWER( <[@]cString>, [<cTokenizer>], [<nTokenCount>],
[<nSkipWidth>] ) -> cString
$ARGUMENTS$
<[@]cString> is the processed string
[<cTokenizer>] is a list of characters separating the tokens
in <cString>
Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
",.;:!\?/\\<>()#&%+-*"
[<nTokenCount>] specifies the number of tokens that
should be processed
Default: all tokens
[<nSkipWidth>] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
$RETURNS$
<cString> the string with the lowercased tokens
$DESCRIPTION$
The TOKENLOWER() function changes the first letter of tokens in <cString>
to lower case. To do this, it uses the same tokenizing mechanism
as the token() function. If TOKENLOWER() extracts a token that starts
with a letter, this letter will be changed to lower case.
You can omit the return value of this function by setting the CSETREF()
switch to .T., but you must then pass <cString> by reference to get
the result.
$EXAMPLES$
? tokenlower( "Hello, World, here I am!" ) // "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!", " W" ) // "hello, World, here i am!"
$TESTS$
tokenlower( "Hello, World, here I am!" ) == "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!", " W" ) == "hello, World, here i am!"
$STATUS$
Ready
$COMPLIANCE$
TOKENLOWER() is compatible with CT3's TOKENLOWER(),
but a new 4th parameter, <nSkipWidth> has been added for
synchronization with the the other token functions.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKEN(),NUMTOKEN(),ATTOKEN(),TOKENUPPER(),TOKENSEP(),CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENUPPER()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Change the first letter of tokens to upper case
* $SYNTAX$
* TOKENUPPER( <[@]cString>, [<cTokenizer>], [<nTokenCount>],
* [<nSkipWidth>] ) -> cString
* $ARGUMENTS$
* <[@]cString> is the processed string
* [<cTokenizer>] is a list of characters separating the tokens
* in <cString>
* Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
* Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
* Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
* ",.;:!\?/\\<>()#&%+-*"
* [<nTokenCount>] specifies the number of tokens that
* should be processed
* Default: all tokens
* [<nSkipWidth>] specifies the maximum number of successive
* tokenizing characters that are combined as
* ONE token stop, e.g. specifying 1 can
* yield to empty token
* Default: 0, any number of successive tokenizing
* characters are combined as ONE token stop
* $RETURNS$
* <cString> the string with the uppercased tokens
* $DESCRIPTION$
* The TOKENUPPER() function changes the first letter of tokens in <cString>
* to upper case. To do this, it uses the same tokenizing mechanism
* as the token() function. If TOKENUPPER() extracts a token that starts
* with a letter, this letter will be changed to upper case.
* You can omit the return value of this function by setting the CSETREF()
* switch to .T., but you must then pass <cString> by reference to get
* the result.
* $EXAMPLES$
* ? tokenupper( "Hello, world, here I am!" ) // "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!", " w" ) // "Hello, wOrld, Here I Am!"
* $TESTS$
* tokenupper( "Hello, world, here I am!" ) == "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!", " w" ) == "Hello, wOrld, Here I Am!"
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENUPPER() is compatible with CT3's TOKENUPPER(),
* but a new 4th parameter, <nSkipWidth> has been added for
* synchronization with the the other token functions.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKEN(),NUMTOKEN(),ATTOKEN(),TOKENLOWER(),TOKENSEP(),CSETREF()
* $END$
/* $DOC$
$FUNCNAME$
TOKENUPPER()
$CATEGORY$
CT3 string functions
$ONELINER$
Change the first letter of tokens to upper case
$SYNTAX$
TOKENUPPER( <[@]cString>, [<cTokenizer>], [<nTokenCount>],
[<nSkipWidth>] ) -> cString
$ARGUMENTS$
<[@]cString> is the processed string
[<cTokenizer>] is a list of characters separating the tokens
in <cString>
Default: Chr( 0 ) + Chr( 9 ) + Chr( 10 ) +
Chr( 13 ) + Chr( 26 ) + Chr( 32 ) +
Chr( 32 ) + Chr( 138 ) + Chr( 141 ) +
",.;:!\?/\\<>()#&%+-*"
[<nTokenCount>] specifies the number of tokens that
should be processed
Default: all tokens
[<nSkipWidth>] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
$RETURNS$
<cString> the string with the uppercased tokens
$DESCRIPTION$
The TOKENUPPER() function changes the first letter of tokens in <cString>
to upper case. To do this, it uses the same tokenizing mechanism
as the token() function. If TOKENUPPER() extracts a token that starts
with a letter, this letter will be changed to upper case.
You can omit the return value of this function by setting the CSETREF()
switch to .T., but you must then pass <cString> by reference to get
the result.
$EXAMPLES$
? tokenupper( "Hello, world, here I am!" ) // "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!", " w" ) // "Hello, wOrld, Here I Am!"
$TESTS$
tokenupper( "Hello, world, here I am!" ) == "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!", " w" ) == "Hello, wOrld, Here I Am!"
$STATUS$
Ready
$COMPLIANCE$
TOKENUPPER() is compatible with CT3's TOKENUPPER(),
but a new 4th parameter, <nSkipWidth> has been added for
synchronization with the the other token functions.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKEN(),NUMTOKEN(),ATTOKEN(),TOKENLOWER(),TOKENSEP(),CSETREF()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENSEP()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Retrieves the token separators of the last token() call
* $SYNTAX$
* TOKENSEP( [<lMode>] ) -> cSeparator
* $ARGUMENTS$
* [<lMode>] if set to .T., the token separator BEHIND the token
* retrieved from the token() call will be returned.
* Default: .F., returns the separator BEFORE the token
* $RETURNS$
* Depending on the setting of <lMode>, the separating character of the
* the token retrieved from the last token() call will be returned.
* These separating characters can now also be retrieved with the token()
* function.
* $DESCRIPTION$
* When one does extract tokens from a string with the token() function,
* one might be interested in the separator characters that have been
* used to extract a specific token. To get this information you can
* either use the TOKENSEP() function after each token() call, or
* use the new 5th and 6th parameter of the token() function.
* $EXAMPLES$
* see TOKEN() function
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENSEP() is compatible with CT3's TOKENSEP().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKEN(),NUMTOKEN(),ATTOKEN(),TOKENLOWER(),TOKENUPPER()
* $END$
/* $DOC$
$FUNCNAME$
TOKENSEP()
$CATEGORY$
CT3 string functions
$ONELINER$
Retrieves the token separators of the last token() call
$SYNTAX$
TOKENSEP( [<lMode>] ) -> cSeparator
$ARGUMENTS$
[<lMode>] if set to .T., the token separator BEHIND the token
retrieved from the token() call will be returned.
Default: .F., returns the separator BEFORE the token
$RETURNS$
Depending on the setting of <lMode>, the separating character of the
the token retrieved from the last token() call will be returned.
These separating characters can now also be retrieved with the token()
function.
$DESCRIPTION$
When one does extract tokens from a string with the token() function,
one might be interested in the separator characters that have been
used to extract a specific token. To get this information you can
either use the TOKENSEP() function after each token() call, or
use the new 5th and 6th parameter of the token() function.
$EXAMPLES$
see TOKEN() function
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
TOKENSEP() is compatible with CT3's TOKENSEP().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKEN(),NUMTOKEN(),ATTOKEN(),TOKENLOWER(),TOKENUPPER()
$END$
*/

View File

@@ -2,393 +2,393 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* TOKENINIT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Initializes a token environment
* $SYNTAX$
* TOKENINIT( <[@]cString>], [<cTokenizer>], [<nSkipWidth>],
* [<@cTokenEnvironment>] ) -> lState
* $ARGUMENTS$
* <[@]cString> is the processed string
* <cTokenizer> is a list of characters separating the tokens
* in <cString>
* Default: Chr(0)+Chr(9)+Chr(10)+Chr(13)+Chr(26)+
* Chr(32)+Chr(32)+Chr(138)+Chr(141)+
* ",.;:!\?/\\<>()#&%+-*"
* <nSkipWidth> specifies the maximum number of successive
* tokenizing characters that are combined as
* ONE token stop, e.g. specifying 1 can
* yield to empty token
* Default: 0, any number of successive tokenizing
* characters are combined as ONE token stop
* <@cTokenEnvironment> is a token environment stored in a binary
* encoded string
* $RETURNS$
* <lState> success of the initialization
* $DESCRIPTION$
* The TOKENINIT() function initializes a token environment. A token
* environment is the information about how a string is to be tokenized.
* This information is created in the process of tokenization of the
* string <cString> - equal to the one used in the TOKEN() function
* with the help of the <cTokenizer> and <nSkipWidth> parameters.
*
* This token environment can be very useful when large strings have
* to be tokenized since the tokenization has to take place only once
* whereas the TOKEN() function must always start the tokenizing process
* from scratch.
*
* Unlike CTIII, this function provides two mechanisms of storing the
* resulting token environment. If a variable is passed by reference
* as 4th parameter, the token environment is stored in this variable,
* otherwise the global token environment is used. Do not modify the
* token environment string directly !
*
* Additionally, a counter is stored in the token environment, so that
* the tokens can successivly be obtained. This counter is first set to 1.
* When the TOKENINIT() function is called without a string a tokenize,
* the counter of either the global environment or the environment given
* by reference in the 4th parameter is rewind to 1.
*
* Additionally, unlike CTIII, tokeninit() does not need the string
* <cString> to be passed by reference, since one must provide the
* string in calls to TOKENNEXT() again.
* $EXAMPLES$
* tokeninit( cString ) // tokenize the string <cString> with default
* // rules and store the token environment globally
* // and eventually delete an old global TE
* tokeninit( @cString ) // no difference in result, but eventually faster,
* // since the string must not be copied
* tokeninit() // rewind counter of global TE to 1
* tokeninit( "1,2,3", "," , 1 ) // tokenize constant string, store in global TE
* tokeninit( cString, , 1, @cTE1) // tokenize cString and store TE in
* // cTE1 only without overriding global TE
* tokeninit( cString, , 1, cTE1 ) // tokenize cString and store TE in
* // GLOBAL TE since 4th parameter is
* // not given by reference !!!
* tokeninit( ,,, @cTE1 ) // set counter in TE stored in cTE1 to 1
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENINIT() is compatible with CTIII's TOKENINIT(),
* but there is an additional parameter featuring local token environments.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKEN(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
TOKENINIT()
$CATEGORY$
CT3 string functions
$ONELINER$
Initializes a token environment
$SYNTAX$
TOKENINIT( <[@]cString>], [<cTokenizer>], [<nSkipWidth>],
[<@cTokenEnvironment>] ) -> lState
$ARGUMENTS$
<[@]cString> is the processed string
<cTokenizer> is a list of characters separating the tokens
in <cString>
Default: Chr(0)+Chr(9)+Chr(10)+Chr(13)+Chr(26)+
Chr(32)+Chr(32)+Chr(138)+Chr(141)+
",.;:!\?/\\<>()#&%+-*"
<nSkipWidth> specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
<@cTokenEnvironment> is a token environment stored in a binary
encoded string
$RETURNS$
<lState> success of the initialization
$DESCRIPTION$
The TOKENINIT() function initializes a token environment. A token
environment is the information about how a string is to be tokenized.
This information is created in the process of tokenization of the
string <cString> - equal to the one used in the TOKEN() function
with the help of the <cTokenizer> and <nSkipWidth> parameters.
This token environment can be very useful when large strings have
to be tokenized since the tokenization has to take place only once
whereas the TOKEN() function must always start the tokenizing process
from scratch.
Unlike CTIII, this function provides two mechanisms of storing the
resulting token environment. If a variable is passed by reference
as 4th parameter, the token environment is stored in this variable,
otherwise the global token environment is used. Do not modify the
token environment string directly !
Additionally, a counter is stored in the token environment, so that
the tokens can successivly be obtained. This counter is first set to 1.
When the TOKENINIT() function is called without a string a tokenize,
the counter of either the global environment or the environment given
by reference in the 4th parameter is rewind to 1.
Additionally, unlike CTIII, tokeninit() does not need the string
<cString> to be passed by reference, since one must provide the
string in calls to TOKENNEXT() again.
$EXAMPLES$
tokeninit( cString ) // tokenize the string <cString> with default
// rules and store the token environment globally
// and eventually delete an old global TE
tokeninit( @cString ) // no difference in result, but eventually faster,
// since the string must not be copied
tokeninit() // rewind counter of global TE to 1
tokeninit( "1,2,3", "," , 1 ) // tokenize constant string, store in global TE
tokeninit( cString, , 1, @cTE1) // tokenize cString and store TE in
// cTE1 only without overriding global TE
tokeninit( cString, , 1, cTE1 ) // tokenize cString and store TE in
// GLOBAL TE since 4th parameter is
// not given by reference !!!
tokeninit( ,,, @cTE1 ) // set counter in TE stored in cTE1 to 1
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
TOKENINIT() is compatible with CTIII's TOKENINIT(),
but there is an additional parameter featuring local token environments.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKEN(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENNEXT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Successivly obtains tokens from a string
* $SYNTAX$
* TOKENNEXT( <[@]cString>, [<nToken>],
* [<@cTokenEnvironment>] ) -> cToken
* $ARGUMENTS$
* <[@]cString> the processed string
* <nToken> a token number
* <@cTokenEnvironment> a token environment
* $RETURNS$
* <cToken> a token from <cString>
* $DESCRIPTION$
* With TOKENNEXT(), the tokens determined with the TOKENINIT() functions
* can be retrieved. To do this, TOKENNEXT() uses the information stored
* in either the global token environment or the local one supplied by
* <cTokenEnvironment>. Note that, is supplied, this 3rd parameter has
* always to be passed by reference.
*
* If the 2nd parameter, <nToken> is given, TOKENNEXT() simply returns
* the <nToken>th token without manipulating the TE counter. Otherwise
* the token pointed to by the TE counter is returned and the counter
* is incremented by one. Like this, a simple loop with TOKENEND() can
* be used to retrieve all tokens of a string successivly.
*
* Note that <cString> does not have to be the same used in TOKENINIT(),
* so that one can do a "correlational tokenization", i.e. tokenize a string
* as if it was another! E.G. using TOKENINIT() with the string
* "AA,BBB" but calling TOKENNEXT() with "CCCEE" would
* give first "CC" and then "EE" (because "CCCEE" is not long enough).
* $EXAMPLES$
* // default behavhiour
* tokeninit( cString ) // initialize a TE
* DO WHILE ! tokenend()
* ? tokennext( cString ) // get all tokens successivly
* ENDDO
* ? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same
* tokenexit() // free the memory used for the global TE
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENNEXT() is compatible with CTIII's TOKENNEXT(),
* but there are two additional parameters featuring local token
* environments and optional access to tokens.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENEXIT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
TOKENNEXT()
$CATEGORY$
CT3 string functions
$ONELINER$
Successivly obtains tokens from a string
$SYNTAX$
TOKENNEXT( <[@]cString>, [<nToken>],
[<@cTokenEnvironment>] ) -> cToken
$ARGUMENTS$
<[@]cString> the processed string
<nToken> a token number
<@cTokenEnvironment> a token environment
$RETURNS$
<cToken> a token from <cString>
$DESCRIPTION$
With TOKENNEXT(), the tokens determined with the TOKENINIT() functions
can be retrieved. To do this, TOKENNEXT() uses the information stored
in either the global token environment or the local one supplied by
<cTokenEnvironment>. Note that, is supplied, this 3rd parameter has
always to be passed by reference.
If the 2nd parameter, <nToken> is given, TOKENNEXT() simply returns
the <nToken>th token without manipulating the TE counter. Otherwise
the token pointed to by the TE counter is returned and the counter
is incremented by one. Like this, a simple loop with TOKENEND() can
be used to retrieve all tokens of a string successivly.
Note that <cString> does not have to be the same used in TOKENINIT(),
so that one can do a "correlational tokenization", i.e. tokenize a string
as if it was another! E.G. using TOKENINIT() with the string
"AA,BBB" but calling TOKENNEXT() with "CCCEE" would
give first "CC" and then "EE" (because "CCCEE" is not long enough).
$EXAMPLES$
// default behavhiour
tokeninit( cString ) // initialize a TE
DO WHILE ! tokenend()
? tokennext( cString ) // get all tokens successivly
ENDDO
? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same
tokenexit() // free the memory used for the global TE
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
TOKENNEXT() is compatible with CTIII's TOKENNEXT(),
but there are two additional parameters featuring local token
environments and optional access to tokens.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENEXIT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENNUM()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Get the total number of tokens in a token environment
* $SYNTAX$
* TOKENNUM( [<@cTokenEnvironment>] ) -> nNumberofTokens
* $ARGUMENTS$
* <@cTokenEnvironment> a token environment
* $RETURNS$
* <nNumberofTokens> number of tokens in the token environment
* $DESCRIPTION$
* The TOKENNUM() function can be used to retrieve the total number
* of tokens in a token environment.
* If the parameter <@cTokenEnvironment> is supplied (must be by
* reference), the information from this token environment is used,
* otherwise the global TE is used.
* $EXAMPLES$
* tokeninit( "a.b.c.d", ".", 1 ) // initialize global TE
* ? tokennum() // --> 4
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENNUM() is a new function in Harbour's CTIII library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
TOKENNUM()
$CATEGORY$
CT3 string functions
$ONELINER$
Get the total number of tokens in a token environment
$SYNTAX$
TOKENNUM( [<@cTokenEnvironment>] ) -> nNumberofTokens
$ARGUMENTS$
<@cTokenEnvironment> a token environment
$RETURNS$
<nNumberofTokens> number of tokens in the token environment
$DESCRIPTION$
The TOKENNUM() function can be used to retrieve the total number
of tokens in a token environment.
If the parameter <@cTokenEnvironment> is supplied (must be by
reference), the information from this token environment is used,
otherwise the global TE is used.
$EXAMPLES$
tokeninit( "a.b.c.d", ".", 1 ) // initialize global TE
? tokennum() // --> 4
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
TOKENNUM() is a new function in Harbour's CTIII library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENEND()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Check whether additional tokens are available with TOKENNEXT()
* $SYNTAX$
* TOKENEND( [<@cTokenEnvironment>] ) -> lTokenEnd
* $ARGUMENTS$
* <@cTokenEnvironment> a token environment
* $RETURNS$
* <lTokenEnd> .T., if additional tokens are available
* $DESCRIPTION$
* The TOKENEND() function can be used to check whether the next
* call to TOKENNEXT() would return a new token. This can not be
* decided with TOKENNEXT() alone, since an empty token cannot be
* distinguished from a "no more" tokens.
* If the parameter <@cTokenEnvironment> is supplied (must be by
* reference), the information from this token environment is used,
* otherwise the global TE is used.
* With a combination of TOKENEND() and TOKENNEXT(), all tokens from a
* string can be retrieved successivly (see example).
* $EXAMPLES$
* tokeninit( "a.b.c.d", ".", 1 ) // initialize global TE
* DO WHILE ! tokenend()
* ? tokennext( "a.b.c.d" ) // get all tokens successivly
* ENDDO
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENEND() is compatible with CTIII's TOKENEND(),
* but there are is an additional parameter featuring local token environments.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN()
* $END$
/* $DOC$
$FUNCNAME$
TOKENEND()
$CATEGORY$
CT3 string functions
$ONELINER$
Check whether additional tokens are available with TOKENNEXT()
$SYNTAX$
TOKENEND( [<@cTokenEnvironment>] ) -> lTokenEnd
$ARGUMENTS$
<@cTokenEnvironment> a token environment
$RETURNS$
<lTokenEnd> .T., if additional tokens are available
$DESCRIPTION$
The TOKENEND() function can be used to check whether the next
call to TOKENNEXT() would return a new token. This can not be
decided with TOKENNEXT() alone, since an empty token cannot be
distinguished from a "no more" tokens.
If the parameter <@cTokenEnvironment> is supplied (must be by
reference), the information from this token environment is used,
otherwise the global TE is used.
With a combination of TOKENEND() and TOKENNEXT(), all tokens from a
string can be retrieved successivly (see example).
$EXAMPLES$
tokeninit( "a.b.c.d", ".", 1 ) // initialize global TE
DO WHILE ! tokenend()
? tokennext( "a.b.c.d" ) // get all tokens successivly
ENDDO
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
TOKENEND() is compatible with CTIII's TOKENEND(),
but there are is an additional parameter featuring local token environments.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENEXIT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Release global token environment
* $SYNTAX$
* TOKENEXIT() -> lStaticEnvironmentReleased
* $ARGUMENTS$
*
* $RETURNS$
* <lStaticEnvironmentReleased> .T., if global token environment is successfully released
* $DESCRIPTION$
* The TOKENEXIT() function releases the memory associated with the
* global token environment. One should use it for every tokeninit()
* using the global TE. Additionally, TOKENEXIT() is implicitly called
* from CTEXIT() to free the memory at library shutdown.
* $EXAMPLES$
* tokeninit( cString ) // initialize a TE
* DO WHILE ! tokenend()
* ? tokennext( cString ) // get all tokens successivly
* ENDDO
* ? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same
* tokenexit() // free the memory used for the global TE
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENEXIT() is a new function in Harbour's CTIII library.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
TOKENEXIT()
$CATEGORY$
CT3 string functions
$ONELINER$
Release global token environment
$SYNTAX$
TOKENEXIT() -> lStaticEnvironmentReleased
$ARGUMENTS$
$RETURNS$
<lStaticEnvironmentReleased> .T., if global token environment is successfully released
$DESCRIPTION$
The TOKENEXIT() function releases the memory associated with the
global token environment. One should use it for every tokeninit()
using the global TE. Additionally, TOKENEXIT() is implicitly called
from CTEXIT() to free the memory at library shutdown.
$EXAMPLES$
tokeninit( cString ) // initialize a TE
DO WHILE ! tokenend()
? tokennext( cString ) // get all tokens successivly
ENDDO
? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same
tokenexit() // free the memory used for the global TE
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
TOKENEXIT() is a new function in Harbour's CTIII library.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOKENAT()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Get start and end positions of tokens in a token environment
* $SYNTAX$
* TOKENAT( [<lSeparatorPositionBehindToken>], [<nToken>],
* [<@cTokenEnvironment>] ) -> nPosition
* $ARGUMENTS$
* <lSeparatorPositionBehindToken> .T., if TOKENAT() should return
* the position of the separator character
* BEHIND the token.
* Default: .F., return start position of a token.
* <nToken> a token number
* <@cTokenEnvironment> a token environment
* $RETURNS$
* <nPosition>
* $DESCRIPTION$
* The TOKENAT() function is used to retrieve the start and end position
* of the tokens in a token environment. Note however that the position of
* last character of a token is given by tokenat (.T.)-1 !!
*
* If the 2nd parameter, <nToken> is given, TOKENAT() returns the
* positions of the <nToken>th token. Otherwise
* the token pointed to by the TE counter, i.e. the token that will
* be retrieved by TOKENNEXT() _NEXT_ is used.
*
* If the parameter <@cTokenEnvironment> is supplied (must be by
* reference), the information from this token environment is used,
* otherwise the global TE is used.
* $EXAMPLES$
*
* $TESTS$
* tokeninit( cString ) // initialize a TE
* DO WHILE ! tokenend()
* ? "From", tokenat(), "to", tokenat( .T. ) - 1
* ? tokennext( cString ) // get all tokens successivly
* ENDDO
* ? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same
* tokenexit() // free the memory used for the global TE
* $STATUS$
* Ready
* $COMPLIANCE$
* TOKENAT() is compatible with CTIII's TOKENAT(),
* but there are two additional parameters featuring local token
* environments and optional access to tokens.
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
TOKENAT()
$CATEGORY$
CT3 string functions
$ONELINER$
Get start and end positions of tokens in a token environment
$SYNTAX$
TOKENAT( [<lSeparatorPositionBehindToken>], [<nToken>],
[<@cTokenEnvironment>] ) -> nPosition
$ARGUMENTS$
<lSeparatorPositionBehindToken> .T., if TOKENAT() should return
the position of the separator character
BEHIND the token.
Default: .F., return start position of a token.
<nToken> a token number
<@cTokenEnvironment> a token environment
$RETURNS$
<nPosition>
$DESCRIPTION$
The TOKENAT() function is used to retrieve the start and end position
of the tokens in a token environment. Note however that the position of
last character of a token is given by tokenat (.T.)-1 !!
If the 2nd parameter, <nToken> is given, TOKENAT() returns the
positions of the <nToken>th token. Otherwise
the token pointed to by the TE counter, i.e. the token that will
be retrieved by TOKENNEXT() _NEXT_ is used.
If the parameter <@cTokenEnvironment> is supplied (must be by
reference), the information from this token environment is used,
otherwise the global TE is used.
$EXAMPLES$
$TESTS$
tokeninit( cString ) // initialize a TE
DO WHILE ! tokenend()
? "From", tokenat(), "to", tokenat( .T. ) - 1
? tokennext( cString ) // get all tokens successivly
ENDDO
? tokennext( cString, 3 ) // get the 3rd token, counter will remain the same
tokenexit() // free the memory used for the global TE
$STATUS$
Ready
$COMPLIANCE$
TOKENAT() is compatible with CTIII's TOKENAT(),
but there are two additional parameters featuring local token
environments and optional access to tokens.
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),SAVETOKEN(),RESTTOKEN(),TOKENEND()
$END$
*/
/* $DOC$
* $FUNCNAME$
* SAVETOKEN()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Save the global token environment
* $SYNTAX$
* SAVETOKEN() -> cStaticTokenEnvironment
* $ARGUMENTS$
*
* $RETURNS$
* <cStaticTokenEnvironment> a binary string encoding the global TE
* $DESCRIPTION$
* The SAVETOKEN() function can be used to store the global TE for future
* use or when two or more incremental tokenizers must the nested.
* Note however that the latter can now be solved with locally stored
* token environments.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* SAVETOKEN() is compatible with CTIII's SAVETOKEN(),
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),RESTTOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
SAVETOKEN()
$CATEGORY$
CT3 string functions
$ONELINER$
Save the global token environment
$SYNTAX$
SAVETOKEN() -> cStaticTokenEnvironment
$ARGUMENTS$
$RETURNS$
<cStaticTokenEnvironment> a binary string encoding the global TE
$DESCRIPTION$
The SAVETOKEN() function can be used to store the global TE for future
use or when two or more incremental tokenizers must the nested.
Note however that the latter can now be solved with locally stored
token environments.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
SAVETOKEN() is compatible with CTIII's SAVETOKEN(),
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),RESTTOKEN(),TOKENEND()
$END$
*/
/* $DOC$
* $FUNCNAME$
* RESTTOKEN()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Restore global token environment
* $SYNTAX$
* RESTTOKEN( <cStaticTokenEnvironment> ) -> cOldStaticEnvironment
* $ARGUMENTS$
* <cStaticTokenEnvironment> a binary string encoding a TE
* $RETURNS$
* <cOldStaticEnvironment> a string encoding the old global TE
* $DESCRIPTION$
* The RESTTOKEN() function restores the global TE to the one encoded
* in <cStaticTokenEnvironment>. This can either be the return value
* of SAVETOKEN() or the value stored in the 4th parameter in a
* TOKENINIT() call.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Ready
* $COMPLIANCE$
* RESTTOKEN() is compatible with CTIII's RESTTOKEN(),
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),TOKENEND()
* $END$
/* $DOC$
$FUNCNAME$
RESTTOKEN()
$CATEGORY$
CT3 string functions
$ONELINER$
Restore global token environment
$SYNTAX$
RESTTOKEN( <cStaticTokenEnvironment> ) -> cOldStaticEnvironment
$ARGUMENTS$
<cStaticTokenEnvironment> a binary string encoding a TE
$RETURNS$
<cOldStaticEnvironment> a string encoding the old global TE
$DESCRIPTION$
The RESTTOKEN() function restores the global TE to the one encoded
in <cStaticTokenEnvironment>. This can either be the return value
of SAVETOKEN() or the value stored in the 4th parameter in a
TOKENINIT() call.
$EXAMPLES$
$TESTS$
$STATUS$
Ready
$COMPLIANCE$
RESTTOKEN() is compatible with CTIII's RESTTOKEN(),
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
TOKENINIT(),TOKENEXIT(),TOKENNEXT(),TOKENNUM(),TOKENAT(),SAVETOKEN(),TOKENEND()
$END$
*/

File diff suppressed because it is too large Load Diff

View File

@@ -2,144 +2,144 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CHARPIX()
* $CATEGORY$
* HBCT video functions
* $ONELINER$
* Gets the number of scan lines per character.
* $SYNTAX$
* CHARPIX() --> nHeight
* $ARGUMENTS$
*
* $RETURNS$
* Returns the number of scan lines per character.
* $DESCRIPTION$
* Returns the number of scan lines per character.
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* This function is xHarbour libct contrib
* $PLATFORMS$
* DJGPP
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
CHARPIX()
$CATEGORY$
HBCT video functions
$ONELINER$
Gets the number of scan lines per character.
$SYNTAX$
CHARPIX() --> nHeight
$ARGUMENTS$
$RETURNS$
Returns the number of scan lines per character.
$DESCRIPTION$
Returns the number of scan lines per character.
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
This function is xHarbour libct contrib
$PLATFORMS$
DJGPP
$FILES$
Library is libct.
$SEEALSO$
$END$
*/
/* $DOC$
* $FUNCNAME$
* VGAPALETTE()
* $CATEGORY$
* HBCT video functions
* $ONELINER$
* Changes VGA palette colors
* $SYNTAX$
* VGAPALETTE( [<cColor|nColor>, [<nRedValue>, <nGreenValue>,
* <nBlueValue]] ) --> lValid
* $ARGUMENTS$
* <cColor|nColor> - the color to change in CA-Cl*pper color notation or
* as a number from 0 to 15.
* <nRedValue>, <nGreenValue>, and <nBlueValue> specify the palette
* settings for the respective portions in the range from 0 to 63.
* If no RGB value is specified, the palette register is reset to
* its default value (currently unsupported).
* If the function is called without parameters, the palette registers for
* all colors are reset to their default values (currently unsupported).
* $RETURNS$
* Returns .T. on success.
* $DESCRIPTION$
*
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* This function is xHarbour libct contrib
* $PLATFORMS$
* DJGPP
* $FILES$
* Library is libct.
* $SEEALSO$
* EGAPALETTE() FONTRESET()
* $END$
/* $DOC$
$FUNCNAME$
VGAPALETTE()
$CATEGORY$
HBCT video functions
$ONELINER$
Changes VGA palette colors
$SYNTAX$
VGAPALETTE( [<cColor|nColor>, [<nRedValue>, <nGreenValue>,
<nBlueValue]] ) --> lValid
$ARGUMENTS$
<cColor|nColor> - the color to change in CA-Cl*pper color notation or
as a number from 0 to 15.
<nRedValue>, <nGreenValue>, and <nBlueValue> specify the palette
settings for the respective portions in the range from 0 to 63.
If no RGB value is specified, the palette register is reset to
its default value (currently unsupported).
If the function is called without parameters, the palette registers for
all colors are reset to their default values (currently unsupported).
$RETURNS$
Returns .T. on success.
$DESCRIPTION$
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
This function is xHarbour libct contrib
$PLATFORMS$
DJGPP
$FILES$
Library is libct.
$SEEALSO$
EGAPALETTE() FONTRESET()
$END$
*/
/* $DOC$
* $FUNCNAME$
* VIDEOTYPE()
* $CATEGORY$
* HBCT video functions
* $ONELINER$
* Detects supported video adapter modes
* $SYNTAX$
* VIDEOTYPE() --> nMask
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: Finish documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* This function is xHarbour libct contrib
* $PLATFORMS$
* DJGPP
* $FILES$
* Library is libct.
* $SEEALSO$
* ISCGA(), ISEGA(), ISHERCULES(), ISMCGA(), ISMONO(), ISPGA(), ISVGA()
* $END$
/* $DOC$
$FUNCNAME$
VIDEOTYPE()
$CATEGORY$
HBCT video functions
$ONELINER$
Detects supported video adapter modes
$SYNTAX$
VIDEOTYPE() --> nMask
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: Finish documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
This function is xHarbour libct contrib
$PLATFORMS$
DJGPP
$FILES$
Library is libct.
$SEEALSO$
ISCGA(), ISEGA(), ISHERCULES(), ISMCGA(), ISMONO(), ISPGA(), ISVGA()
$END$
*/
/* $DOC$
* $FUNCNAME$
* SETFONT()
* $CATEGORY$
* HBCT video functions
* $ONELINER$
* Loads font from a string.
* $SYNTAX$
* SETFONT( <cFontString>, [<nFontArea>], [<nOffset>], [<nCounter>] ) --> nError
* or:
* SETFONT( <cFontString>, [<nFontArea>], [<lCompute>] ) --> nError
* $ARGUMENTS$
* <cFontString> Binary string containing a valid font definition.
* <nFontArea> Number of a font area where the font must be loaded.
* <nOffset> First character code to be loaded.
* <nCounter> Number of characters to load.
* <lCompute> When .T., the function computes font height automatically.
* $RETURNS$
*
* $DESCRIPTION$
* TODO: Finish documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* This function is xHarbour libct contrib
* $PLATFORMS$
* DJGPP
* $FILES$
* Library is libct.
* $SEEALSO$
*
* $END$
/* $DOC$
$FUNCNAME$
SETFONT()
$CATEGORY$
HBCT video functions
$ONELINER$
Loads font from a string.
$SYNTAX$
SETFONT( <cFontString>, [<nFontArea>], [<nOffset>], [<nCounter>] ) --> nError
or:
SETFONT( <cFontString>, [<nFontArea>], [<lCompute>] ) --> nError
$ARGUMENTS$
<cFontString> Binary string containing a valid font definition.
<nFontArea> Number of a font area where the font must be loaded.
<nOffset> First character code to be loaded.
<nCounter> Number of characters to load.
<lCompute> When .T., the function computes font height automatically.
$RETURNS$
$DESCRIPTION$
TODO: Finish documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
This function is xHarbour libct contrib
$PLATFORMS$
DJGPP
$FILES$
Library is libct.
$SEEALSO$
$END$
*/

View File

@@ -2,66 +2,66 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* WORDREPL()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replacement of double characters
* $SYNTAX$
* WORDREPL( <cDoubleCharacterSearchString>, <[@]cString>,
* <cDoubleCharacterReplaceString>, [<lMode>] ) -> cString
* $ARGUMENTS$
* <cDoubleCharacterSearchString> is a string of double characters
* that should be replaced
* <[@]cString> is the processed string
* <cDoubleCharacterReplaceString> is a string of double characters that
* replace the one of <cSearchString>
* [<lMode>] sets the replacement method (see description)
* Default: .F.
* $RETURNS$
* cString the processed string
* $DESCRIPTION$
* The WORDREPL() takes the double characters of <cDoubleCharacterSearchString>
* one after the other and searches for them in <cString>.
* For <lMode> set to .F., this search is successful, if the double
* character sequence in <cString> starts at an odd position or at any
* position, if <lMode> is set to .T.
* If this happens, the double character sequence will be replaced with
* the corresponding double character sequence of <cDoubleCharacterReplaceString>.
* If <cDoubleCharacterReplaceString> is shorter than <cDoubleCharacterSearchString>
* the last double sequence of <cDoubleCharacterReplaceString> is used for
* the "rest" of <cDoubleCharacterSearchString>. Note that the last double
* character sequence in "AABBC" is "BB" in this context !!
* After the replacement the function restarts the search in <cString>
* BEHIND the replacement if the CSETATMUPA() switch is turned off, or
* BEHIND the first character of the replacement if the switch is turned on.
* (see examples for this !)
* One can omit the return value of this function by setting the CSETREF()
* to .T., but one must then pass <cString> by reference to get a result.
* $EXAMPLES$
* ? wordrepl( "CC", "AABBCCDDEE", "XX" ) // "AABBXXDDEE"
* ? wordrepl( "aa", "1aaaa", "ba" ) // "1abaa"
* ? wordrepl( "aa", "1aaaa", "ba", .T. ) // "1baba"
* csetatmupa( .T. )
* ? wordrepl( "aa", "1aaaa", "ba" ) // "1abaa"
* ? wordrepl( "aa", "1aaaa", "ba", .T. ) // "1bbba"
* $TESTS$
* wordrepl( "CC", "AABBCCDDEE", "XX" ) == "AABBXXDDEE"
* wordrepl( "aa", "1aaaa", "ba" ) == "1abaa"
* wordrepl( "aa", "1aaaa", "ba", .T. ) == "1baba"
* Eval( {|| csetatmupa( .T. ), wordrepl( "aa", "1aaaa", "ba" ) } ) == "1abaa"
* Eval( {|| csetatmupa( .T. ), wordrepl( "aa", "1aaaa", "ba", .T. ) } ) == "1bbba"
* $STATUS$
* Ready
* $COMPLIANCE$
* WORDREPL() is compatible with CT3's WORDREPL().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CHARREPL(),RANGEREPL(),POSREPL(),CSETREF(),CSETATMUPA()
* $END$
/* $DOC$
$FUNCNAME$
WORDREPL()
$CATEGORY$
CT3 string functions
$ONELINER$
Replacement of double characters
$SYNTAX$
WORDREPL( <cDoubleCharacterSearchString>, <[@]cString>,
<cDoubleCharacterReplaceString>, [<lMode>] ) -> cString
$ARGUMENTS$
<cDoubleCharacterSearchString> is a string of double characters
that should be replaced
<[@]cString> is the processed string
<cDoubleCharacterReplaceString> is a string of double characters that
replace the one of <cSearchString>
[<lMode>] sets the replacement method (see description)
Default: .F.
$RETURNS$
cString the processed string
$DESCRIPTION$
The WORDREPL() takes the double characters of <cDoubleCharacterSearchString>
one after the other and searches for them in <cString>.
For <lMode> set to .F., this search is successful, if the double
character sequence in <cString> starts at an odd position or at any
position, if <lMode> is set to .T.
If this happens, the double character sequence will be replaced with
the corresponding double character sequence of <cDoubleCharacterReplaceString>.
If <cDoubleCharacterReplaceString> is shorter than <cDoubleCharacterSearchString>
the last double sequence of <cDoubleCharacterReplaceString> is used for
the "rest" of <cDoubleCharacterSearchString>. Note that the last double
character sequence in "AABBC" is "BB" in this context !!
After the replacement the function restarts the search in <cString>
BEHIND the replacement if the CSETATMUPA() switch is turned off, or
BEHIND the first character of the replacement if the switch is turned on.
(see examples for this !)
One can omit the return value of this function by setting the CSETREF()
to .T., but one must then pass <cString> by reference to get a result.
$EXAMPLES$
? wordrepl( "CC", "AABBCCDDEE", "XX" ) // "AABBXXDDEE"
? wordrepl( "aa", "1aaaa", "ba" ) // "1abaa"
? wordrepl( "aa", "1aaaa", "ba", .T. ) // "1baba"
csetatmupa( .T. )
? wordrepl( "aa", "1aaaa", "ba" ) // "1abaa"
? wordrepl( "aa", "1aaaa", "ba", .T. ) // "1bbba"
$TESTS$
wordrepl( "CC", "AABBCCDDEE", "XX" ) == "AABBXXDDEE"
wordrepl( "aa", "1aaaa", "ba" ) == "1abaa"
wordrepl( "aa", "1aaaa", "ba", .T. ) == "1baba"
Eval( {|| csetatmupa( .T. ), wordrepl( "aa", "1aaaa", "ba" ) } ) == "1abaa"
Eval( {|| csetatmupa( .T. ), wordrepl( "aa", "1aaaa", "ba", .T. ) } ) == "1bbba"
$STATUS$
Ready
$COMPLIANCE$
WORDREPL() is compatible with CT3's WORDREPL().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CHARREPL(),RANGEREPL(),POSREPL(),CSETREF(),CSETATMUPA()
$END$
*/

View File

@@ -2,35 +2,35 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* WORDTOCHAR()
* $CATEGORY$
* CT3 string functions
* $ONELINER$
* Replace double with single characters
* $SYNTAX$
* WORDTOCHAR( <cDoubleCharacterSearchString>, <cString>,
* <cSingleCharacterReplaceString> ) -> cString
* $ARGUMENTS$
*
* $RETURNS$
*
* $DESCRIPTION$
* TODO: add documentation
* $EXAMPLES$
*
* $TESTS$
*
* $STATUS$
* Started
* $COMPLIANCE$
* WORDTOCHAR() is compatible with CT3's WORDTOCHAR().
* $PLATFORMS$
* All
* $FILES$
* Library is libct.
* $SEEALSO$
* CSETATMUPA(),CHARREPL(),WORDREPL()
* $END$
/* $DOC$
$FUNCNAME$
WORDTOCHAR()
$CATEGORY$
CT3 string functions
$ONELINER$
Replace double with single characters
$SYNTAX$
WORDTOCHAR( <cDoubleCharacterSearchString>, <cString>,
<cSingleCharacterReplaceString> ) -> cString
$ARGUMENTS$
$RETURNS$
$DESCRIPTION$
TODO: add documentation
$EXAMPLES$
$TESTS$
$STATUS$
Started
$COMPLIANCE$
WORDTOCHAR() is compatible with CT3's WORDTOCHAR().
$PLATFORMS$
All
$FILES$
Library is libct.
$SEEALSO$
CSETATMUPA(),CHARREPL(),WORDREPL()
$END$
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,336 +2,324 @@
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 2000 Jose Lalin <dezac@corevia.com>
* Documentation for: AMONTHS, ADAYS, ISLEAPYEAR, DAYSINMONTH, EOM, BOM,
* WOM, DOY, WOY, EOY, BOY
*
* See COPYING for licensing terms.
*
/* $DOC$
$FUNCNAME$
AMONTHS()
$CATEGORY$
Date
$ONELINER$
Returns an array with the months names.
$SYNTAX$
AMONTHS() --> aMonths
$ARGUMENTS$
None
$RETURNS$
<aMonths> The array which holds the months names.
$DESCRIPTION$
This function returns an array with all the months names in the
selected current language.
$EXAMPLES$
aMonths := AMonths()
? aMonths[ 1 ] // -> January
? aMonths[ 1 ] // -> Enero (if the selected language is Spanish)
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
ADAYS()
$END$
*/
/* $DOC$
* $FUNCNAME$
* AMONTHS()
* $CATEGORY$
* Date
* $ONELINER$
* Returns an array with the months names.
* $SYNTAX$
* AMONTHS() --> aMonths
* $ARGUMENTS$
* None
* $RETURNS$
* <aMonths> The array which holds the months names.
* $DESCRIPTION$
* This function returns an array with all the months names in the
* selected current language.
* $EXAMPLES$
* aMonths := AMonths()
* ? aMonths[ 1 ] // -> January
* ? aMonths[ 1 ] // -> Enero (if the selected language is Spanish)
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* ADAYS()
* $END$
/* $DOC$
$FUNCNAME$
ADAYS()
$CATEGORY$
Date
$ONELINER$
Returns an array with the days names.
$SYNTAX$
ADAYS() --> aDays
$ARGUMENTS$
None
$RETURNS$
<aDays> The array which holds the days names.
$DESCRIPTION$
This function returns an array with all the days names in the
selected current language.
$EXAMPLES$
aDays := ADays()
? aDays[ 1 ] // -> Sunday
? aDays[ 1 ] // -> Domingo (if the selected language is Spanish)
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
ADAYS()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ADAYS()
* $CATEGORY$
* Date
* $ONELINER$
* Returns an array with the days names.
* $SYNTAX$
* ADAYS() --> aDays
* $ARGUMENTS$
* None
* $RETURNS$
* <aDays> The array which holds the days names.
* $DESCRIPTION$
* This function returns an array with all the days names in the
* selected current language.
* $EXAMPLES$
* aDays := ADays()
* ? aDays[ 1 ] // -> Sunday
* ? aDays[ 1 ] // -> Domingo (if the selected language is Spanish)
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* ADAYS()
* $END$
/* $DOC$
$FUNCNAME$
ISLEAPYEAR()
$CATEGORY$
Date
$ONELINER$
Checks if the given date is a leap year.
$SYNTAX$
ISLEAPYEAR( <dDate> ) --> lTrueOrFalse
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<lTrueOrFalse> A logical that indicates if the date year is leap
$DESCRIPTION$
This function returns true if the given date is a leap year and
false if isn't.
$EXAMPLES$
? IsLeapYear( hb_SToD( "20000101" ) ) // -> .T.
? IsLeapYear( hb_SToD( "20010101" ) ) // -> .F.
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
DAYSINMONTH()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ISLEAPYEAR()
* $CATEGORY$
* Date
* $ONELINER$
* Checks if the given date is a leap year.
* $SYNTAX$
* ISLEAPYEAR( <dDate> ) --> lTrueOrFalse
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <lTrueOrFalse> A logical that indicates if the date year is leap
* $DESCRIPTION$
* This function returns true if the given date is a leap year and
* false if isn't.
* $EXAMPLES$
* ? IsLeapYear( hb_SToD( "20000101" ) ) // -> .T.
* ? IsLeapYear( hb_SToD( "20010101" ) ) // -> .F.
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* DAYSINMONTH()
* $END$
/* $DOC$
$FUNCNAME$
DAYSINMONTH()
$CATEGORY$
Date
$ONELINER$
Gets the days in a month.
$SYNTAX$
DAYSINMONTH( <dDate> ) --> nDays
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<nDays> The number of days of the month.
$DESCRIPTION$
This function returns the number of days of the given date month.
$EXAMPLES$
? DaysInMonth( hb_SToD( "20000101" ) ) // -> 31
? DaysInMonth( hb_SToD( "20000201" ) ) // -> 29
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
IsLeapYear()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DAYSINMONTH()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the days in a month.
* $SYNTAX$
* DAYSINMONTH( <dDate> ) --> nDays
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <nDays> The number of days of the month.
* $DESCRIPTION$
* This function returns the number of days of the given date month.
* $EXAMPLES$
* ? DaysInMonth( hb_SToD( "20000101" ) ) // -> 31
* ? DaysInMonth( hb_SToD( "20000201" ) ) // -> 29
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* IsLeapYear()
* $END$
/* $DOC$
$FUNCNAME$
EOM()
$CATEGORY$
Date
$ONELINER$
Gets the last day in a month.
$SYNTAX$
EOM( <dDate> ) --> dEOM
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<dEOM> The last day in the month.
$DESCRIPTION$
This function returns the last day of a given month date.
$EXAMPLES$
SET DATE ANSI
? EOM( hb_SToD( "20000101" ) ) // -> "2000.01.31"
? EOM( hb_SToD( "20000201" ) ) // -> "2000.02.29"
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
BOM(),WOM()
$END$
*/
/* $DOC$
* $FUNCNAME$
* EOM()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the last day in a month.
* $SYNTAX$
* EOM( <dDate> ) --> dEOM
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <dEOM> The last day in the month.
* $DESCRIPTION$
* This function returns the last day of a given month date.
* $EXAMPLES$
* SET DATE ANSI
* ? EOM( hb_SToD( "20000101" ) ) // -> "2000.01.31"
* ? EOM( hb_SToD( "20000201" ) ) // -> "2000.02.29"
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* BOM(),WOM()
* $END$
/* $DOC$
$FUNCNAME$
BOM()
$CATEGORY$
Date
$ONELINER$
Gets the first day in a month.
$SYNTAX$
BOM( <dDate> ) --> dBOM
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<dBOM> The first day in the month.
$DESCRIPTION$
This function returns the first day of a given month date.
$EXAMPLES$
SET DATE ANSI
? BOM( hb_SToD( "20000125" ) ) // -> "2000.01.01"
? BOM( hb_SToD( "20000224" ) ) // -> "2000.02.01"
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
EOM(),WOM()
$END$
*/
/* $DOC$
* $FUNCNAME$
* BOM()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the first day in a month.
* $SYNTAX$
* BOM( <dDate> ) --> dBOM
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <dBOM> The first day in the month.
* $DESCRIPTION$
* This function returns the first day of a given month date.
* $EXAMPLES$
* SET DATE ANSI
* ? BOM( hb_SToD( "20000125" ) ) // -> "2000.01.01"
* ? BOM( hb_SToD( "20000224" ) ) // -> "2000.02.01"
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* EOM(),WOM()
* $END$
/* $DOC$
$FUNCNAME$
DOY()
$CATEGORY$
Date
$ONELINER$
Gets the day number of the year.
$SYNTAX$
DOY( <dDate> ) --> nDay
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<nDay> The day number
$DESCRIPTION$
This function returns the day number of the year for a given date.
$EXAMPLES$
? DOY( hb_SToD( "20000131" ) ) // -> 31
? DOY( hb_SToD( "20000220" ) ) // -> 51
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
WOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DOY()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the day number of the year.
* $SYNTAX$
* DOY( <dDate> ) --> nDay
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <nDay> The day number
* $DESCRIPTION$
* This function returns the day number of the year for a given date.
* $EXAMPLES$
* ? DOY( hb_SToD( "20000131" ) ) // -> 31
* ? DOY( hb_SToD( "20000220" ) ) // -> 51
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* WOY()
* $END$
/* $DOC$
$FUNCNAME$
WOY()
$CATEGORY$
Date
$ONELINER$
Gets the week number of the year.
$SYNTAX$
WOY( <dDate>, <lIso> ) --> nWeek
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<nWeek> The week number
<lIso> Flag that indicates if <nWeek> is in ISO format.
$DESCRIPTION$
This function returns the week number of the year for a given date.
It returns the week number in ISO format ( range 0 - 52, by default
or passing TRUE as second parameter) or 1 - 52 if lIso is FALSE.
$EXAMPLES$
? WOY( hb_SToD( "20000131" ) ) // -> 3
? WOY( hb_SToD( "20000131" ), .F. ) // -> 4
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
DOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* WOY()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the week number of the year.
* $SYNTAX$
* WOY( <dDate>, <lIso> ) --> nWeek
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <nWeek> The week number
* <lIso> Flag that indicates if <nWeek> is in ISO format.
* $DESCRIPTION$
* This function returns the week number of the year for a given date.
* It returns the week number in ISO format ( range 0 - 52, by default
* or passing TRUE as second parameter) or 1 - 52 if lIso is FALSE.
* $EXAMPLES$
* ? WOY( hb_SToD( "20000131" ) ) // -> 3
* ? WOY( hb_SToD( "20000131" ), .F. ) // -> 4
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* DOY()
* $END$
/* $DOC$
$FUNCNAME$
EOY()
$CATEGORY$
Date
$ONELINER$
Gets the last date of the year.
$SYNTAX$
EOY( <dDate> ) --> dEOY
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<dEOY> The last date of the year.
$DESCRIPTION$
This function returns the last date of a given year date.
$EXAMPLES$
SET DATE ANSI
? EOY( hb_SToD( "20000101" ) ) // -> "2000.12.31"
? EOY( hb_SToD( "20010101" ) ) // -> "2001.12.31"
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
BOY()
$END$
*/
/* $DOC$
* $FUNCNAME$
* EOY()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the last date of the year.
* $SYNTAX$
* EOY( <dDate> ) --> dEOY
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <dEOY> The last date of the year.
* $DESCRIPTION$
* This function returns the last date of a given year date.
* $EXAMPLES$
* SET DATE ANSI
* ? EOY( hb_SToD( "20000101" ) ) // -> "2000.12.31"
* ? EOY( hb_SToD( "20010101" ) ) // -> "2001.12.31"
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* BOY()
* $END$
*/
/* $DOC$
* $FUNCNAME$
* BOY()
* $CATEGORY$
* Date
* $ONELINER$
* Gets the first date of the year.
* $SYNTAX$
* BOY( <dDate> ) --> dBOY
* $ARGUMENTS$
* <dDate> A valid date.
* $RETURNS$
* <dBOY> The first day in the year.
* $DESCRIPTION$
* This function returns the first date of a given year date.
* $EXAMPLES$
* SET DATE ANSI
* ? BOY( hb_SToD( "20000125" ) ) // -> "2000.01.01"
* ? BOY( hb_SToD( "20010224" ) ) // -> "2001.01.01"
* $STATUS$
* R
* $COMPLIANCE$
* This function is new in Harbour.
* $PLATFORMS$
* All
* $FILES$
* Library is libmisc
* $SEEALSO$
* EOY()
* $END$
/* $DOC$
$FUNCNAME$
BOY()
$CATEGORY$
Date
$ONELINER$
Gets the first date of the year.
$SYNTAX$
BOY( <dDate> ) --> dBOY
$ARGUMENTS$
<dDate> A valid date.
$RETURNS$
<dBOY> The first day in the year.
$DESCRIPTION$
This function returns the first date of a given year date.
$EXAMPLES$
SET DATE ANSI
? BOY( hb_SToD( "20000125" ) ) // -> "2000.01.01"
? BOY( hb_SToD( "20010224" ) ) // -> "2001.01.01"
$STATUS$
R
$COMPLIANCE$
This function is new in Harbour.
$PLATFORMS$
All
$FILES$
Library is libmisc
$SEEALSO$
EOY()
$END$
*/

View File

@@ -2,93 +2,82 @@
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
* Documentation
*
* See COPYING for licensing terms.
*
*/
/* $DOC$
* $FUNCNAME$
* TFileRead()
* $CATEGORY$
* Harbour Tools
* $ONELINER$
* Read a file one line at a time
* $SYNTAX$
* oFile := TFileRead():New( <cFileName> [, <nReadSize> ] )
* $ARGUMENTS$
* <cFileName> is the required name of the file to be read. </par>
*
* <nReadSize> is the optional size to use when reading from the file.
* The default value is 4096 and the allowed range is 1 through 65535.
* Any value outside of this range causes the default value to be used. </par>
* $RETURNS$
* An instance of the File Reader class </par>
* $DESCRIPTION$
* TFileRead() is used to access a file one line at a time. You must
* specify the name of the file when an instance of the class is created. </par>
* The class data should be considered private to the class. </par>
*
* The class methods are as follows: </par>
*
* New() Creates a new instance of the TFileRead class. </par>
*
* Open([<nFlags>]) Opens the file for reading. The optional nFlags
* parameter can use any of the FOPEN() flags from
* fileio.ch. The default is FO_READ + FO_SHARED.
* Calling this method when the file is already
* open causes the next ReadLine() to start over
* from the beginning of the file. </par>
* Close() Closes the file. </par>
*
* ReadLine() Returns one line from the file, stripping the
* newline characters. The following sequences are
* treated as one newline: 1) CR CR LF; 2) CR LF;
* 3) LF; and 4) CR. Note: LF CR is 2 newlines. </par>
* Name() Returns the name of the file. </par>
*
* IsOpen() Returns .T. if the file is open. </par>
*
* MoreToRead() Returns .T. if there are more lines to be read
* (think of it as an inverse EOF function).
*
* Error() Returns .T. if an error has occurred. </par>
*
* ErrorNo() Returns the current error code. </par>
*
* ErrorMsg([<cPre>]) Returns a formatted error message. </par>
* $EXAMPLES$
* PROCEDURE Main( cFile )
* LOCAL oFile := TFileRead():New( cFile )
*
* oFile:Open()
* IF oFile:Error()
* OutStd( oFile:ErrorMsg( "FileRead: " ) )
* OutStd( hb_eol() )
* ELSE
* DO WHILE oFile:MoreToRead()
* OutStd( oFile:ReadLine() )
* OutStd( hb_eol() )
* ENDDO
* oFile:Close()
* ENDIF
* RETURN
* $TESTS$
* See Examples
* $STATUS$
* R
* $COMPLIANCE$
* This is a new Harbour Tools class
* $FILES$
* Library is libmisc
* $SEEALSO$
* TClass()
* $END$
/* $DOC$
$FUNCNAME$
TFileRead()
$CATEGORY$
Harbour Tools
$ONELINER$
Read a file one line at a time
$SYNTAX$
oFile := TFileRead():New( <cFileName> [, <nReadSize> ] )
$ARGUMENTS$
<cFileName> is the required name of the file to be read. </par>
<nReadSize> is the optional size to use when reading from the file.
The default value is 4096 and the allowed range is 1 through 65535.
Any value outside of this range causes the default value to be used. </par>
$RETURNS$
An instance of the File Reader class </par>
$DESCRIPTION$
TFileRead() is used to access a file one line at a time. You must
specify the name of the file when an instance of the class is created. </par>
The class data should be considered private to the class. </par>
The class methods are as follows: </par>
New() Creates a new instance of the TFileRead class. </par>
Open([<nFlags>]) Opens the file for reading. The optional nFlags
parameter can use any of the FOPEN() flags from
fileio.ch. The default is FO_READ + FO_SHARED.
Calling this method when the file is already
open causes the next ReadLine() to start over
from the beginning of the file. </par>
Close() Closes the file. </par>
ReadLine() Returns one line from the file, stripping the
newline characters. The following sequences are
treated as one newline: 1) CR CR LF; 2) CR LF;
3) LF; and 4) CR. Note: LF CR is 2 newlines. </par>
Name() Returns the name of the file. </par>
IsOpen() Returns .T. if the file is open. </par>
MoreToRead() Returns .T. if there are more lines to be read
(think of it as an inverse EOF function).
Error() Returns .T. if an error has occurred. </par>
ErrorNo() Returns the current error code. </par>
ErrorMsg([<cPre>]) Returns a formatted error message. </par>
$EXAMPLES$
PROCEDURE Main( cFile )
LOCAL oFile := TFileRead():New( cFile )
oFile:Open()
IF oFile:Error()
OutStd( oFile:ErrorMsg( "FileRead: " ) )
OutStd( hb_eol() )
ELSE
DO WHILE oFile:MoreToRead()
OutStd( oFile:ReadLine() )
OutStd( hb_eol() )
ENDDO
oFile:Close()
ENDIF
RETURN
$TESTS$
See Examples
$STATUS$
R
$COMPLIANCE$
This is a new Harbour Tools class
$FILES$
Library is libmisc
$SEEALSO$
TClass()
$END$
*/

View File

@@ -2,240 +2,228 @@
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999 Luiz Rafael Culik <Culik@sl.conex.net>
* Documentation
*
* See COPYING for licensing terms.
*
/* $DOC$
$FUNCNAME$
ISBIN()
$CATEGORY$
Conversion Tools
$ONELINER$
Check if the value is a Binary Number
$SYNTAX$
ISBIN(<cN>) -><cNr>
$ARGUMENTS$
<cN> STRING TO BE CHECKED
$RETURNS$
<cNr> .T. IF THE STRING IS BYNARY,otherwise .F.
$DESCRIPTION$
check if the passed string is a bynary number or not
$FILES$
Library is libmisc
$SEEALSO$
ISOCTAL(),ISDEC(),ISHEXA()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ISBIN()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Check if the value is a Binary Number
* $SYNTAX$
* ISBIN(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> STRING TO BE CHECKED
* $RETURNS$
* <cNr> .T. IF THE STRING IS BYNARY,otherwise .F.
* $DESCRIPTION$
* check if the passed string is a bynary number or not
* $FILES$
* Library is libmisc
* $SEEALSO$
* ISOCTAL(),ISDEC(),ISHEXA()
* $END$
/* $DOC$
$FUNCNAME$
ISOCTAL()
$CATEGORY$
Conversion Tools
$ONELINER$
Check if the value is a Octal Number
$SYNTAX$
ISOCTAL(<cN>) -><cNr>
$ARGUMENTS$
<cN> STRING TO BE CHECKED
$RETURNS$
<cNr> .T. IF THE STRING IS OCTAL;otherwise .F.
$DESCRIPTION$
check if the passed string is a octal number or not
$FILES$
Library is libmisc
$SEEALSO$
ISBIN(),ISDEC(),ISHEXA()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ISOCTAL()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Check if the value is a Octal Number
* $SYNTAX$
* ISOCTAL(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> STRING TO BE CHECKED
* $RETURNS$
* <cNr> .T. IF THE STRING IS OCTAL;otherwise .F.
* $DESCRIPTION$
* check if the passed string is a octal number or not
* $FILES$
* Library is libmisc
* $SEEALSO$
* ISBIN(),ISDEC(),ISHEXA()
* $END$
/* $DOC$
$FUNCNAME$
ISDEC()
$CATEGORY$
Conversion Tools
$ONELINER$
Check if the value is a Decimal Number
$SYNTAX$
ISDEC(<cN>) -><cNr>
$ARGUMENTS$
<cN> STRING TO BE CHECKED
$RETURNS$
<cNr> .T. IF THE STRING IS DECIMAL;otherwise .F.
$DESCRIPTION$
check if the passed string is a decimal number or not
$FILES$
Library is libmisc
$SEEALSO$
ISOCTAL(),ISBIN(),ISHEXA()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ISDEC()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Check if the value is a Decimal Number
* $SYNTAX$
* ISDEC(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> STRING TO BE CHECKED
* $RETURNS$
* <cNr> .T. IF THE STRING IS DECIMAL;otherwise .F.
* $DESCRIPTION$
* check if the passed string is a decimal number or not
* $FILES$
* Library is libmisc
* $SEEALSO$
* ISOCTAL(),ISBIN(),ISHEXA()
* $END$
/* $DOC$
$FUNCNAME$
ISHEXA()
$CATEGORY$
Conversion Tools
$ONELINER$
Check if the value is a Hexal Number
$SYNTAX$
ISHEXA(<cN>) -><cNr>
$ARGUMENTS$
<cN> STRING TO BE CHECKED
$RETURNS$
<cNr> .T. IF THE STRING IS HEXA;otherwise .F.
$DESCRIPTION$
check if the passed string is a hexa number or not
$FILES$
Library is libmisc
$SEEALSO$
ISOCTAL(),ISDEC(),ISBIN()
$END$
*/
/* $DOC$
* $FUNCNAME$
* ISHEXA()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Check if the value is a Hexal Number
* $SYNTAX$
* ISHEXA(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> STRING TO BE CHECKED
* $RETURNS$
* <cNr> .T. IF THE STRING IS HEXA;otherwise .F.
* $DESCRIPTION$
* check if the passed string is a hexa number or not
* $FILES$
* Library is libmisc
* $SEEALSO$
* ISOCTAL(),ISDEC(),ISBIN()
* $END$
/* $DOC$
$FUNCNAME$
DECTOBIN()
$CATEGORY$
Conversion Tools
$ONELINER$
Converts a Decimal Value to Binary
$SYNTAX$
DECTOBIN(<cN>) -><cNr>
$ARGUMENTS$
<cN> NUMBER TO BE CONVERTED
$RETURNS$
<cNr> NUMBER CONVERTED
$DESCRIPTION$
This function converts a string <cN> from an decimal value
to an binary value.
$FILES$
Library is libmisc
$SEEALSO$
Dectohexa(),dectooctal()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DECTOBIN()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Converts a Decimal Value to Binary
* $SYNTAX$
* DECTOBIN(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> NUMBER TO BE CONVERTED
* $RETURNS$
* <cNr> NUMBER CONVERTED
* $DESCRIPTION$
* This function converts a string <cN> from an decimal value
* to an binary value.
* $FILES$
* Library is libmisc
* $SEEALSO$
* Dectohexa(),dectooctal()
* $END$
/* $DOC$
$FUNCNAME$
DECTOOCTAL()
$CATEGORY$
Conversion Tools
$ONELINER$
Converts a Decimal Value to Octal
$SYNTAX$
DECTOOCTAL(<cN>) -><cNr>
$ARGUMENTS$
<cN> NUMBER TO BE CONVERTED
$RETURNS$
<cNr> NUMBER CONVERTED
$DESCRIPTION$
This function converts a string <cN> from an decimal value
to an octal value.
$FILES$
Library is libmisc
$SEEALSO$
Dectohexa(),dectobin()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DECTOOCTAL()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Converts a Decimal Value to Octal
* $SYNTAX$
* DECTOOCTAL(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> NUMBER TO BE CONVERTED
* $RETURNS$
* <cNr> NUMBER CONVERTED
* $DESCRIPTION$
* This function converts a string <cN> from an decimal value
* to an octal value.
* $FILES$
* Library is libmisc
* $SEEALSO$
* Dectohexa(),dectobin()
* $END$
/* $DOC$
$FUNCNAME$
DECTOHEXA()
$CATEGORY$
Conversion Tools
$ONELINER$
Converts a Decimal Value to Hexa
$SYNTAX$
DECTOHEXA(<cN>) -><cNr>
$ARGUMENTS$
<cN> NUMBER TO BE CONVERTED
$RETURNS$
<cNr> NUMBER CONVERTED
$DESCRIPTION$
This function converts a string <cN> from an decimal value
to an hexadecimal value.
$FILES$
Library is libmisc
$SEEALSO$
Dectobin(),dectooctal()
$END$
*/
/* $DOC$
* $FUNCNAME$
* DECTOHEXA()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Converts a Decimal Value to Hexa
* $SYNTAX$
* DECTOHEXA(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> NUMBER TO BE CONVERTED
* $RETURNS$
* <cNr> NUMBER CONVERTED
* $DESCRIPTION$
* This function converts a string <cN> from an decimal value
* to an hexadecimal value.
* $FILES$
* Library is libmisc
* $SEEALSO$
* Dectobin(),dectooctal()
* $END$
/* $DOC$
$FUNCNAME$
BINTODEC()
$CATEGORY$
Conversion Tools
$ONELINER$
Converts a Binary Value to Decimal
$SYNTAX$
BIntODEC(<cN>) -><cNr>
$ARGUMENTS$
<cN> NUMBER TO BE CONVERTED
$RETURNS$
<cNr> NUMBER CONVERTED
$DESCRIPTION$
This function converts a string <cN> from an binary value
to a numeric decimal value.
$FILES$
Library is libmisc
$SEEALSO$
OctaltoDec(),HexatoDec()
$END$
*/
/* $DOC$
* $FUNCNAME$
* BINTODEC()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Converts a Binary Value to Decimal
* $SYNTAX$
* BIntODEC(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> NUMBER TO BE CONVERTED
* $RETURNS$
* <cNr> NUMBER CONVERTED
* $DESCRIPTION$
* This function converts a string <cN> from an binary value
* to a numeric decimal value.
* $FILES$
* Library is libmisc
* $SEEALSO$
* OctaltoDec(),HexatoDec()
* $END$
/* $DOC$
$FUNCNAME$
OCTALTODEC()
$CATEGORY$
Conversion Tools
$ONELINER$
Converts a Octal Value to Decimal
$SYNTAX$
OCTALTODEC(<cN>) -><cNr>
$ARGUMENTS$
<cN> NUMBER TO BE CONVERTED
$RETURNS$
<cNr> NUMBER CONVERTED
$DESCRIPTION$
This function converts a string <cN> from an octal value
to a numeric decimal value.
$FILES$
Library is libmisc
$SEEALSO$
BintoDec(),HexatoDec()
$END$
*/
/* $DOC$
* $FUNCNAME$
* OCTALTODEC()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Converts a Octal Value to Decimal
* $SYNTAX$
* OCTALTODEC(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> NUMBER TO BE CONVERTED
* $RETURNS$
* <cNr> NUMBER CONVERTED
* $DESCRIPTION$
* This function converts a string <cN> from an octal value
* to a numeric decimal value.
* $FILES$
* Library is libmisc
* $SEEALSO$
* BintoDec(),HexatoDec()
* $END$
/* $DOC$
$FUNCNAME$
HEXATODEC()
$CATEGORY$
Conversion Tools
$ONELINER$
Converts a Hexa Value to Decimal
$SYNTAX$
HEXATODEC(<cN>) -><cNr>
$ARGUMENTS$
<cN> NUMBER TO BE CONVERTED
$RETURNS$
<cNr> NUMBER CONVERTED
$DESCRIPTION$
This function converts a string <cN> from an hexadecimal value
to a numeric decimal value.
$FILES$
Library is libmisc
$SEEALSO$
OctaltoDec(),BintoDec()
$END$
*/
/* $DOC$
* $FUNCNAME$
* HEXATODEC()
* $CATEGORY$
* Conversion Tools
* $ONELINER$
* Converts a Hexa Value to Decimal
* $SYNTAX$
* HEXATODEC(<cN>) -><cNr>
* $ARGUMENTS$
* <cN> NUMBER TO BE CONVERTED
* $RETURNS$
* <cNr> NUMBER CONVERTED
* $DESCRIPTION$
* This function converts a string <cN> from an hexadecimal value
* to a numeric decimal value.
* $FILES$
* Library is libmisc
* $SEEALSO$
* OctaltoDec(),BintoDec()
* $END$
*/

View File

@@ -2,134 +2,121 @@
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 2000 Alexander Kresin <alex@belacy.belgorod.su>
* FIELDTYPE() documentation
* FIELDSIZE() documentation
* FIELDDECI() documentation
*
* See COPYING for licensing terms.
*
/* $DOC$
$FUNCNAME$
FIELDTYPE()
$CATEGORY$
Database Tools
$ONELINER$
Determines the type of a given field.
$SYNTAX$
FIELDTYPE(<nFieldNum>) --> cFieldType
$ARGUMENTS$
<nFieldNum> Data field , which type need to be determined.
$RETURNS$
FIELDTYPE() returns the character that designates the type of
a given field:</par>
<table>
'C' character string;
'N' numeric;
'L' logical;
'D' date;
'M' memo.
</table>
$DESCRIPTION$
This function determines the type of a field, designated by its
number.
$EXAMPLES$
PROCEDURE Main()
LOCAL i
USE tests NEW
FOR i := 1 TO FCount()
? FieldType( i )
NEXT
USE
RETURN
$STATUS$
R
$COMPLIANCE$
This function is CA-Cl*pper tools compatible
$FILES$
Library is libmisc
$SEEALSO$
FIELDSIZE(),FIELDDECI()
$END$
*/
/* $DOC$
* $FUNCNAME$
* FIELDTYPE()
* $CATEGORY$
* Database Tools
* $ONELINER$
* Determines the type of a given field.
* $SYNTAX$
* FIELDTYPE(<nFieldNum>) --> cFieldType
* $ARGUMENTS$
* <nFieldNum> Data field , which type need to be determined.
* $RETURNS$
* FIELDTYPE() returns the character that designates the type of
* a given field:</par>
* <table>
* 'C' character string;
* 'N' numeric;
* 'L' logical;
* 'D' date;
* 'M' memo.
* </table>
* $DESCRIPTION$
* This function determines the type of a field, designated by its
* number.
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL i
* USE tests NEW
* FOR i := 1 TO FCount()
* ? FieldType( i )
* NEXT
* USE
* RETURN
* $STATUS$
* R
* $COMPLIANCE$
* This function is CA-Cl*pper tools compatible
* $FILES$
* Library is libmisc
* $SEEALSO$
* FIELDSIZE(),FIELDDECI()
* $END$
/* $DOC$
$FUNCNAME$
FIELDSIZE()
$CATEGORY$
Database tools
$ONELINER$
Determines the size of a given field.
$SYNTAX$
FIELDSIZE(<nFieldNum>) --> nFieldSize
$ARGUMENTS$
<nFieldNum> Data field , which size need to be determined.
$RETURNS$
FIELDSIZE() returns the number that designates the size of a given
field.
$DESCRIPTION$
This function determines the size of a field, designated by its number.
$EXAMPLES$
PROCEDURE Main()
LOCAL i
USE tests NEW
FOR i := 1 TO FCount()
? FieldSize( i )
NEXT
USE
RETURN
xed>
$STATUS$
R
$COMPLIANCE$
This function is CA-Cl*pper tools compatible
$FILES$
Library is libmisc
$SEEALSO$
FIELDTYPE(),FIELDDECI()
$END$
*/
/* $DOC$
* $FUNCNAME$
* FIELDSIZE()
* $CATEGORY$
* Database tools
* $ONELINER$
* Determines the size of a given field.
* $SYNTAX$
* FIELDSIZE(<nFieldNum>) --> nFieldSize
* $ARGUMENTS$
* <nFieldNum> Data field , which size need to be determined.
* $RETURNS$
* FIELDSIZE() returns the number that designates the size of a given
* field.
* $DESCRIPTION$
* This function determines the size of a field, designated by its number.
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL i
* USE tests NEW
* FOR i := 1 TO FCount()
* ? FieldSize( i )
* NEXT
* USE
* RETURN
* </fixed>
* $STATUS$
* R
* $COMPLIANCE$
* This function is CA-Cl*pper tools compatible
* $FILES$
* Library is libmisc
* $SEEALSO$
* FIELDTYPE(),FIELDDECI()
* $END$
*/
/* $DOC$
* $FUNCNAME$
* FIELDDECI()
* $CATEGORY$
* Database tools
* $ONELINER$
* Determines the number of decimal places of a given numeric field.
* $SYNTAX$
* FIELDDECI(<nFieldNum>) --> nFieldDeci
* $ARGUMENTS$
* <nFieldNum> Numeric data field , for which number of decimal
* places need to be determined.
* $RETURNS$
* FIELDDECI() returns the numeric value that designates the number
* of decimal places of a given field.
* $DESCRIPTION$
* This function determines the number of decimal places of a given numeric field.
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL i
* USE tests NEW
* FOR i := 1 TO FCount()
* ? FieldDeci( i )
* NEXT
* USE
* RETURN
* </fixed>
* $STATUS$
* R
* $COMPLIANCE$
* This function is CA-Cl*pper tools compatible
* $FILES$
* Library is libmisc
* $SEEALSO$
* FIELDTYPE(),FIELDSIZE()
* $END$
/* $DOC$
$FUNCNAME$
FIELDDECI()
$CATEGORY$
Database tools
$ONELINER$
Determines the number of decimal places of a given numeric field.
$SYNTAX$
FIELDDECI(<nFieldNum>) --> nFieldDeci
$ARGUMENTS$
<nFieldNum> Numeric data field , for which number of decimal
places need to be determined.
$RETURNS$
FIELDDECI() returns the numeric value that designates the number
of decimal places of a given field.
$DESCRIPTION$
This function determines the number of decimal places of a given numeric field.
$EXAMPLES$
PROCEDURE Main()
LOCAL i
USE tests NEW
FOR i := 1 TO FCount()
? FieldDeci( i )
NEXT
USE
RETURN
xed>
$STATUS$
R
$COMPLIANCE$
This function is CA-Cl*pper tools compatible
$FILES$
Library is libmisc
$SEEALSO$
FIELDTYPE(),FIELDSIZE()
$END$
*/

View File

@@ -2,261 +2,250 @@
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999 Luiz Rafael Culik <Culik@sl.conex.net>
* Documentation
*
* See COPYING for licensing terms.
*
/* $DOC$
$FUNCNAME$
THtml()
$CATEGORY$
Harbour Tools
$ONELINER$
Html Class
$SYNTAX$
oHtml:=THtml():New(<cFile>) --> oHtm
$ARGUMENTS$
<cFile> Name of the Html file to create </par>
$RETURNS$
<oHtm> An instance of the THtml Class </par>
$DESCRIPTION$
THtml() is a class that creates an .html file of the same
name you pass to the constructor. </par>
The class methods are as follows: </par>
New(<cFile>) Create a new instance of the THtml class </par>
Close() Close the created file </par>
WriteTitle(<cTitle>) Write the file title </par>
WritePar(<cPar>) Writes a paragraph </par>
WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
WriteLink(<cLink>,<cName>) Write a link to another topic </par>
WriteText(<cText>) Write any text </par>
$EXAMPLES$
PROCEDURE Main()
LOCAL oHtm
oHtm := THTML():New( "www\harbour.html" )
oHtm:WriteTitle( "Harbour Reference Guide" )
oHtm:WritePar( "HARBOUR" )
oHtm:WriteLink( "OverView" )
oHtm:WriteLink( "License" )
oHtm:WriteLink( "http://www.gnu.org/copyleft/gpl" )
oHtm:WritePar( "See the Links Above" )
oHtm:Close()
RETURN
r>
$STATUS$
R
$COMPLIANCE$
This is a new Harbour Tools class </par>
$PLATFORMS$
ALL </par>
$SEEALSO$
TCLASS()
$END$
*/
/* $DOC$
* $FUNCNAME$
* THtml()
* $CATEGORY$
* Harbour Tools
* $ONELINER$
* Html Class
* $SYNTAX$
* oHtml:=THtml():New(<cFile>) --> oHtm
* $ARGUMENTS$
* <cFile> Name of the Html file to create </par>
* $RETURNS$
* <oHtm> An instance of the THtml Class </par>
* $DESCRIPTION$
* THtml() is a class that creates an .html file of the same
* name you pass to the constructor. </par>
* The class methods are as follows: </par>
* New(<cFile>) Create a new instance of the THtml class </par>
* Close() Close the created file </par>
* WriteTitle(<cTitle>) Write the file title </par>
* WritePar(<cPar>) Writes a paragraph </par>
* WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
* WriteLink(<cLink>,<cName>) Write a link to another topic </par>
* WriteText(<cText>) Write any text </par>
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL oHtm
*
* oHtm := THTML():New( "www\harbour.html" )
* oHtm:WriteTitle( "Harbour Reference Guide" )
* oHtm:WritePar( "HARBOUR" )
* oHtm:WriteLink( "OverView" )
* oHtm:WriteLink( "License" )
* oHtm:WriteLink( "http://www.gnu.org/copyleft/gpl" )
* oHtm:WritePar( "See the Links Above" )
* oHtm:Close()
*
* RETURN
* </par>
* $STATUS$
* R
* $COMPLIANCE$
* This is a new Harbour Tools class </par>
* $PLATFORMS$
* ALL </par>
* $SEEALSO$
* TCLASS()
* $END$
/* $DOC$
$FUNCNAME$
TOs2()
$CATEGORY$
Harbour Tools
$ONELINER$
OS/2 Documentation Class
$SYNTAX$
oNg:=TOs2():New(<cFile>) --> oOs2
$ARGUMENTS$
<cFile> Name of the IPF Source file to create </par>
$RETURNS$
<oOs2> An instance of the TOs2 Class </par>
$DESCRIPTION$
TOs2() is a class that creates the OS/2 IPF Source
of the same name you pass to the constructor. </par>
The class methods are as follows: </par>
New(<cFile>) Create a new instance of the TOs2 class </par>
Close() Close the created file </par>
WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
WritePar(<cPar>) Write a paragraph </par>
WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
WriteLink(<cLink>) Write a link to another topic </par>
ScanLink(<clink>) Scan the aLinkRef array for a valid topic </par>
DosToOs2Text(<cText>) Convert a Dos string to a OS/2 String </par>
$EXAMPLES$
PROCEDURE Main()
LOCAL oNg
oNg := TOs2():New( "ngi\harbour.ngi" )
oNg:WriteTitle( "Harbour Reference Guide" )
oNg:WritePar( "HARBOUR" )
oNg:WriteLink( "OverView" )
oNg:WriteLink( "License" )
oNg:WritePar( "See the Links Above" )
oNg:Close()
RETURN
$STATUS$
R
$COMPLIANCE$
This is a new Harbour Tools class </par>
$PLATFORMS$
ALL </par>
$SEEALSO$
TNortonGuide()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TOs2()
* $CATEGORY$
* Harbour Tools
* $ONELINER$
* OS/2 Documentation Class
* $SYNTAX$
* oNg:=TOs2():New(<cFile>) --> oOs2
* $ARGUMENTS$
* <cFile> Name of the IPF Source file to create </par>
* $RETURNS$
* <oOs2> An instance of the TOs2 Class </par>
* $DESCRIPTION$
* TOs2() is a class that creates the OS/2 IPF Source
* of the same name you pass to the constructor. </par>
* The class methods are as follows: </par>
* New(<cFile>) Create a new instance of the TOs2 class </par>
* Close() Close the created file </par>
* WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
* WritePar(<cPar>) Write a paragraph </par>
* WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
* WriteLink(<cLink>) Write a link to another topic </par>
* ScanLink(<clink>) Scan the aLinkRef array for a valid topic </par>
* DosToOs2Text(<cText>) Convert a Dos string to a OS/2 String </par>
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL oNg
*
* oNg := TOs2():New( "ngi\harbour.ngi" )
* oNg:WriteTitle( "Harbour Reference Guide" )
* oNg:WritePar( "HARBOUR" )
* oNg:WriteLink( "OverView" )
* oNg:WriteLink( "License" )
*
* oNg:WritePar( "See the Links Above" )
* oNg:Close()
*
* RETURN
* $STATUS$
* R
* $COMPLIANCE$
* This is a new Harbour Tools class </par>
* $PLATFORMS$
* ALL </par>
* $SEEALSO$
* TNortonGuide()
* $END$
/* $DOC$
$FUNCNAME$
TNortonGuide()
$CATEGORY$
Harbour Tools
$ONELINER$
Norton Guide Class
$SYNTAX$
oNg:=TNortonGuide():New(<cFile>) --> oNg
$ARGUMENTS$
<cFile> Name of the Ng Source file to create </par>
$RETURNS$
<oNg> An instance of the TNortonGuide Class </par>
$DESCRIPTION$
TNortonGuide() is a class that creates the Norton Guide Source
Code of the same name you pass to the constructor. </par>
The class methods are as follows: </par>
New(<cFile>) Create an instance of the TNortonGuide class </par>
Close() Close the created file </par>
WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
WritePar(<cPar>) Write a paragraph </par>
WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
WriteLink(<cLink>) Write a link to another topic </par>
$EXAMPLES$
PROCEDURE Main()
LOCAL oNg
oNg := TNortonGuide():New( "ngi\harbour.ngi" )
oNg:WriteTitle( "Harbour Reference Guide" )
oNg:WritePar( "HARBOUR" )
oNg:WriteLink( "OverView" )
oNg:WriteLink( "License" )
oNg:WritePar( "See the Links Above" )
oNg:Close()
RETURN
$STATUS$
R
$COMPLIANCE$
This is a new Harbour Tools class </par>
$PLATFORMS$
ALL </par>
$SEEALSO$
TTroff(),TRtf(),THtml(),TOs2()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TNortonGuide()
* $CATEGORY$
* Harbour Tools
* $ONELINER$
* Norton Guide Class
* $SYNTAX$
* oNg:=TNortonGuide():New(<cFile>) --> oNg
* $ARGUMENTS$
* <cFile> Name of the Ng Source file to create </par>
* $RETURNS$
* <oNg> An instance of the TNortonGuide Class </par>
* $DESCRIPTION$
* TNortonGuide() is a class that creates the Norton Guide Source
* Code of the same name you pass to the constructor. </par>
* The class methods are as follows: </par>
* New(<cFile>) Create an instance of the TNortonGuide class </par>
* Close() Close the created file </par>
* WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
* WritePar(<cPar>) Write a paragraph </par>
* WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
* WriteLink(<cLink>) Write a link to another topic </par>
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL oNg
*
* oNg := TNortonGuide():New( "ngi\harbour.ngi" )
* oNg:WriteTitle( "Harbour Reference Guide" )
* oNg:WritePar( "HARBOUR" )
* oNg:WriteLink( "OverView" )
* oNg:WriteLink( "License" )
*
* oNg:WritePar( "See the Links Above" )
* oNg:Close()
*
* RETURN
* $STATUS$
* R
* $COMPLIANCE$
* This is a new Harbour Tools class </par>
* $PLATFORMS$
* ALL </par>
* $SEEALSO$
* TTroff(),TRtf(),THtml(),TOs2()
* $END$
/* $DOC$
$FUNCNAME$
TRtf()
$CATEGORY$
Harbour Tools
$ONELINER$
Rtf Class
$SYNTAX$
oNg:=TRtf():New(<cFile>) --> oRtf
$ARGUMENTS$
<cFile> Name of the RTF file to create </par>
$RETURNS$
<oRtf> An instance of the TRtf Class </par>
$DESCRIPTION$
TRtf() is a class that creates the RTF Documentation Source
Code of the same name you pass to the constructor. </par>
The class methods are as follows: </par>
New(<cFile>) Create a new instance of the TRtf class </par>
Close() Close the create file </par>
WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
WritePar(<cPar>) Write a paragraph </par>
WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
WriteLink(<cLink>) Write a link to another topic </par>
WriteHeader() Write the RTF header </par>
EndPar() Write the end paragraph delimiter </par>
$EXAMPLES$
PROCEDURE Main()
LOCAL oRtf
oRtf := TRtf():New( "rtf\harbour.rtf" )
oRtf:WriteHeader()
oRtf:WriteTitle( "Harbour Reference Guide" )
oRtf:WritePar( "HARBOUR" ):Endpar()
oRtf:WriteLink( "OverView" )
oRtf:WriteLink( "License" )
oRtf:WritePar( "See the Links Above" ):EndPar()
oRtf:Close()
RETURN
$STATUS$
R
$COMPLIANCE$
This is a new Harbour Tools class </par>
$PLATFORMS$
ALL </par>
$SEEALSO$
TNortonGuide()
$END$
*/
/* $DOC$
* $FUNCNAME$
* TRtf()
* $CATEGORY$
* Harbour Tools
* $ONELINER$
* Rtf Class
* $SYNTAX$
* oNg:=TRtf():New(<cFile>) --> oRtf
* $ARGUMENTS$
* <cFile> Name of the RTF file to create </par>
* $RETURNS$
* <oRtf> An instance of the TRtf Class </par>
* $DESCRIPTION$
* TRtf() is a class that creates the RTF Documentation Source
* Code of the same name you pass to the constructor. </par>
* The class methods are as follows: </par>
* New(<cFile>) Create a new instance of the TRtf class </par>
* Close() Close the create file </par>
* WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
* WritePar(<cPar>) Write a paragraph </par>
* WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
* WriteLink(<cLink>) Write a link to another topic </par>
* WriteHeader() Write the RTF header </par>
* EndPar() Write the end paragraph delimiter </par>
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL oRtf
*
* oRtf := TRtf():New( "rtf\harbour.rtf" )
* oRtf:WriteHeader()
* oRtf:WriteTitle( "Harbour Reference Guide" )
* oRtf:WritePar( "HARBOUR" ):Endpar()
* oRtf:WriteLink( "OverView" )
* oRtf:WriteLink( "License" )
*
* oRtf:WritePar( "See the Links Above" ):EndPar()
* oRtf:Close()
*
* RETURN
* $STATUS$
* R
* $COMPLIANCE$
* This is a new Harbour Tools class </par>
* $PLATFORMS$
* ALL </par>
* $SEEALSO$
* TNortonGuide()
* $END$
*/
/* $DOC$
* $FUNCNAME$
* TTroff()
* $CATEGORY$
* Harbour Tools
* $ONELINER$
* Troff Class
* $SYNTAX$
* oTroff:=TTrof():New(<cFile>) --> oTrf
* $ARGUMENTS$
* <cFile> Name of the Troff file to create </par>
* $RETURNS$
* <oTrf> instance of the TTroff Class </par>
* $DESCRIPTION$
* TTroff() is a class that creates the TROFF Documentation Source
* Code of the same name you pass to the constructor. </par>
* The class methods are as follows: </par>
* New(<cFile>) Create a new instance of the THtml class
* Close() Close the created file </par>
* WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
* WritePar(<cPar>) Write a paragraph </par>
* WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
* WriteLink(<cLink>) Write a link to another topic </par>
* WriteText() Writes text without formating </par>
* $EXAMPLES$
* PROCEDURE Main()
* LOCAL oTroff
*
* oTroff := TTroff():New( "tr\harbour.ngi" )
* oTroff:WriteTitle( "Harbour Reference Guide" )
* oTroff:WritePar( "HARBOUR" )
* oTroff:WriteLink( "OverView" )
* oTroff:WriteLink( "License" )
*
* oTroff:WritePar( "See the Links Above" )
* oTroff:Close()
*
* RETURN
* $STATUS$
* R
* $COMPLIANCE$
* This is a new Harbour Tools class </par>
* $PLATFORMS$
* ALL </par>
* $SEEALSO$
* TNortonGuide()
* $END$
/* $DOC$
$FUNCNAME$
TTroff()
$CATEGORY$
Harbour Tools
$ONELINER$
Troff Class
$SYNTAX$
oTroff:=TTrof():New(<cFile>) --> oTrf
$ARGUMENTS$
<cFile> Name of the Troff file to create </par>
$RETURNS$
<oTrf> instance of the TTroff Class </par>
$DESCRIPTION$
TTroff() is a class that creates the TROFF Documentation Source
Code of the same name you pass to the constructor. </par>
The class methods are as follows: </par>
New(<cFile>) Create a new instance of the THtml class
Close() Close the created file </par>
WriteTitle(<cTopic>,<cTitle>) Write the file title </par>
WritePar(<cPar>) Write a paragraph </par>
WriteParBold(<cPar>) Same as WritePar(), but the text is bold </par>
WriteLink(<cLink>) Write a link to another topic </par>
WriteText() Writes text without formating </par>
$EXAMPLES$
PROCEDURE Main()
LOCAL oTroff
oTroff := TTroff():New( "tr\harbour.ngi" )
oTroff:WriteTitle( "Harbour Reference Guide" )
oTroff:WritePar( "HARBOUR" )
oTroff:WriteLink( "OverView" )
oTroff:WriteLink( "License" )
oTroff:WritePar( "See the Links Above" )
oTroff:Close()
RETURN
$STATUS$
R
$COMPLIANCE$
This is a new Harbour Tools class </par>
$PLATFORMS$
ALL </par>
$SEEALSO$
TNortonGuide()
$END$
*/

View File

@@ -2,86 +2,86 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* CD()
* $CATEGORY$
* Dos Tools
* $ONELINER$
* Change the Current Directory
* $SYNTAX$
* CD(<cDir>) --> lSuccess
* $ARGUMENTS$
* <cDir> DIR TO BE CHANGED
* $RETURNS$
* <lSucess> .T. IF SUCESSFUL; otherwise .F.
* $DESCRIPTION$
* CHANGE THE CURRENT DIRECTORY
* $EXAMPLES$
* IF CD( "OLA" )
* RETURN .T.
* ELSE
* RETURN .F.
* ENDIF
* $FILES$
* Header is Fileio.ch
* $SEEALSO$
* MD(),RD()
* $END$
/* $DOC$
$FUNCNAME$
CD()
$CATEGORY$
Dos Tools
$ONELINER$
Change the Current Directory
$SYNTAX$
CD(<cDir>) --> lSuccess
$ARGUMENTS$
<cDir> DIR TO BE CHANGED
$RETURNS$
<lSucess> .T. IF SUCESSFUL; otherwise .F.
$DESCRIPTION$
CHANGE THE CURRENT DIRECTORY
$EXAMPLES$
IF CD( "OLA" )
RETURN .T.
ELSE
RETURN .F.
ENDIF
$FILES$
Header is Fileio.ch
$SEEALSO$
MD(),RD()
$END$
*/
/* $DOC$
* $FUNCNAME$
* MD()
* $CATEGORY$
* Dos Tools
* $ONELINER$
* Creates a Directory
* $SYNTAX$
* MD(<cDir>) -> <lSucess>
* $ARGUMENTS$
* <cDir> DIRECTORY TO BE CREATED
* $RETURNS$
* <lSucess> .T. IF SUCESSFUL; otherwise .F.
* $DESCRIPTION$
* CREATE A DIRECTORY
* $EXAMPLES$
* IF MD( "OLA" )
* RETURN .T.
* ELSE
* RETURN .F.
* ENDIF
* $FILES$
* Header is Fileio.ch
* $SEEALSO$
* CD(),MD()
* $END$
/* $DOC$
$FUNCNAME$
MD()
$CATEGORY$
Dos Tools
$ONELINER$
Creates a Directory
$SYNTAX$
MD(<cDir>) -> <lSucess>
$ARGUMENTS$
<cDir> DIRECTORY TO BE CREATED
$RETURNS$
<lSucess> .T. IF SUCESSFUL; otherwise .F.
$DESCRIPTION$
CREATE A DIRECTORY
$EXAMPLES$
IF MD( "OLA" )
RETURN .T.
ELSE
RETURN .F.
ENDIF
$FILES$
Header is Fileio.ch
$SEEALSO$
CD(),MD()
$END$
*/
/* $DOC$
* $FUNCNAME$
* RD()
* $CATEGORY$
* Dos Tools
* $ONELINER$
* Remove a Directory
* $SYNTAX$
* RD(<cDir>) --> <lSucess>
* $ARGUMENTS$
* <cDir> DIR TO BE DELETED
* $RETURNS$
* <lSucess> .T. IF SUCESSFUL; otherwise .F.
* $DESCRIPTION$
* REMOVE A DIRECTORY
* $EXAMPLES$
* IF RD( "OLA" )
* RETURN .T.
* ELSE
* RETURN .F.
* ENDIF
* $FILES$
* Header is Fileio.ch
* $SEEALSO$
* CD(),MD()
* $END$
/* $DOC$
$FUNCNAME$
RD()
$CATEGORY$
Dos Tools
$ONELINER$
Remove a Directory
$SYNTAX$
RD(<cDir>) --> <lSucess>
$ARGUMENTS$
<cDir> DIR TO BE DELETED
$RETURNS$
<lSucess> .T. IF SUCESSFUL; otherwise .F.
$DESCRIPTION$
REMOVE A DIRECTORY
$EXAMPLES$
IF RD( "OLA" )
RETURN .T.
ELSE
RETURN .F.
ENDIF
$FILES$
Header is Fileio.ch
$SEEALSO$
CD(),MD()
$END$
*/

View File

@@ -2,59 +2,48 @@
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999-2001 Viktor Szakats (harbour syenar.net)
* STRFORMAT() documentation
*
* See COPYING for licensing terms.
*
*/
/* $DOC$
* $FUNCNAME$
* StrFormat()
* $CATEGORY$
* String Tools
* $ONELINER$
* Format a string
* $SYNTAX$
* StrFormat(<cMask>[, <cPar1>[, <cParn>[, ...]]) --> cString
* $ARGUMENTS$
* <cMask> Holds the mask for the resulting string </par>
* <cParn> Holds the strings to be inserted in the mask
* maximum 9 of them can be specified. </par>
* $RETURNS$
* <cString> Return the mask with all the parameters inserted. </par>
* $DESCRIPTION$
* String replacment, can be useful when writing international
* apps. You can separate the constant strings from the variable ones.
* Each %1 - %9 marks will be replaced with the appropriate parameter
* from the parameter list. </par>
* Marks can be in any order, and can be duplicated. </par>
* You can print "%" character with "%%". </par>
* $EXAMPLES$
* StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" )
* StrFormat( "This is %1 from %2", "Victor", "Hungary" )
* StrFormat( "%2 %1 %2", "Param1", "Param2" )
* $TESTS$
* ? StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" )
* ? StrFormat( "This is %1 from %2", "Victor", "Hungary" )
* ? StrFormat( "%2 %1 %2", "Param1", "Param2" )
* ? StrFormat( "Hello" )
* ? StrFormat( "%1 - %2", "one" )
* ? StrFormat( "%1 - %2", "one", "two" )
* ? StrFormat( "%2 - %1", "one", "two" )
* ? StrFormat( "%2 - %", "one", "two" )
* ? StrFormat( "%% - %", "one", "two" )
* ? StrFormat( "%9 - %", "one", "two" )
* $STATUS$
* Done
* $COMPLIANCE$
* All platforms
* $FILES$
* Library is libmisc
* $END$
/* $DOC$
$FUNCNAME$
StrFormat()
$CATEGORY$
String Tools
$ONELINER$
Format a string
$SYNTAX$
StrFormat(<cMask>[, <cPar1>[, <cParn>[, ...]]) --> cString
$ARGUMENTS$
<cMask> Holds the mask for the resulting string </par>
<cParn> Holds the strings to be inserted in the mask
maximum 9 of them can be specified. </par>
$RETURNS$
<cString> Return the mask with all the parameters inserted. </par>
$DESCRIPTION$
String replacment, can be useful when writing international
apps. You can separate the constant strings from the variable ones.
Each %1 - %9 marks will be replaced with the appropriate parameter
from the parameter list. </par>
Marks can be in any order, and can be duplicated. </par>
You can print "%" character with "%%". </par>
$EXAMPLES$
StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" )
StrFormat( "This is %1 from %2", "Victor", "Hungary" )
StrFormat( "%2 %1 %2", "Param1", "Param2" )
$TESTS$
? StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" )
? StrFormat( "This is %1 from %2", "Victor", "Hungary" )
? StrFormat( "%2 %1 %2", "Param1", "Param2" )
? StrFormat( "Hello" )
? StrFormat( "%1 - %2", "one" )
? StrFormat( "%1 - %2", "one", "two" )
? StrFormat( "%2 - %1", "one", "two" )
? StrFormat( "%2 - %", "one", "two" )
? StrFormat( "%% - %", "one", "two" )
? StrFormat( "%9 - %", "one", "two" )
$STATUS$
Done
$COMPLIANCE$
All platforms
$FILES$
Library is libmisc
$END$
*/

View File

@@ -2,49 +2,49 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AADDITION()
* $CATEGORY$
* Array
* $ONELINER$
* Add elements unique of source array to target array
* $SYNTAX$
* FT_AADDITION( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ;
* -> aNewArray
* $ARGUMENTS$
* <aList1> is the primary array.
*
* <aList2> is the secondary array.
*
* <lTrimmer> is a logical value denoting whether leading or
* trailing spaces should be included in the
* comparison. If .T., then ignores spaces in
* comparison, defaults to .T., .F. includes spaces.
*
* <lCaseSens> is a logical value denoting case sensitivity.
* If .T., then comparison is sensitive to case,
* defaults to .T., .F. ignores case.
* $RETURNS$
* An array of the union of aList1 and aList2.
* $DESCRIPTION$
* This function will add the elements unique of aList2 with aList1.
* It returns a new array including all the elements of aList1
* plus the unique elements of aList2.
* $EXAMPLES$
* aList1 := { "apple", "orange", "pear" }
* aList2 := { "apple ", "banana", "PEAR" }
*
* FT_AADDITION( aList1, aList2 )
* // ignores spaces, sensitive to case
* // returns { "apple", "orange", "pear", "banana", "PEAR" }
*
* FT_AADDITION( aList1, aList2, , .F. )
* // ignores spaces, not sensitive to case
* // returns { "apple", "orange", "pear", "banana" }
*
* FT_AADDITION( aList1, aList2, .F., .F. )
* // sensitive to spaces, not sensitive to case
* // returns { "apple", "orange", "pear", "apple ", "banana" }
* $END$
/* $DOC$
$FUNCNAME$
FT_AADDITION()
$CATEGORY$
Array
$ONELINER$
Add elements unique of source array to target array
$SYNTAX$
FT_AADDITION( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ;
-> aNewArray
$ARGUMENTS$
<aList1> is the primary array.
<aList2> is the secondary array.
<lTrimmer> is a logical value denoting whether leading or
trailing spaces should be included in the
comparison. If .T., then ignores spaces in
comparison, defaults to .T., .F. includes spaces.
<lCaseSens> is a logical value denoting case sensitivity.
If .T., then comparison is sensitive to case,
defaults to .T., .F. ignores case.
$RETURNS$
An array of the union of aList1 and aList2.
$DESCRIPTION$
This function will add the elements unique of aList2 with aList1.
It returns a new array including all the elements of aList1
plus the unique elements of aList2.
$EXAMPLES$
aList1 := { "apple", "orange", "pear" }
aList2 := { "apple ", "banana", "PEAR" }
FT_AADDITION( aList1, aList2 )
// ignores spaces, sensitive to case
// returns { "apple", "orange", "pear", "banana", "PEAR" }
FT_AADDITION( aList1, aList2, , .F. )
// ignores spaces, not sensitive to case
// returns { "apple", "orange", "pear", "banana" }
FT_AADDITION( aList1, aList2, .F., .F. )
// sensitive to spaces, not sensitive to case
// returns { "apple", "orange", "pear", "apple ", "banana" }
$END$
*/

View File

@@ -2,37 +2,37 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AAVG()
* $CATEGORY$
* Array
* $ONELINER$
* Average numeric values in an array
* $SYNTAX$
* FT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nAverage
* $ARGUMENTS$
* <aArray> is the array containing the elements to be averaged.
*
* <nStartIndex> is the first array item to include,
* defaults to first element.
*
* <nEndIndex> is the last array element to include,
* defaults to all elements.
* $RETURNS$
* The average of the specified array elements.
* $DESCRIPTION$
* This function is used to get a numeric average of selected or all
* elements of an array.
*
* This routine requires FT_ASUM().
* $EXAMPLES$
* FT_AAVG( aSubTotals ) // Get Average of Entire Array
*
* FT_AAVG( aSubTotals, 5 ) // Get Average of 5th Element On
*
* FT_AAVG( aSubTotals, , 10 ) // Get Average of 1st 10 Elements
*
* FT_AAVG( aSubTotals, 5, 10 ) // Get Average of Elements 5-10
* $END$
/* $DOC$
$FUNCNAME$
FT_AAVG()
$CATEGORY$
Array
$ONELINER$
Average numeric values in an array
$SYNTAX$
FT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nAverage
$ARGUMENTS$
<aArray> is the array containing the elements to be averaged.
<nStartIndex> is the first array item to include,
defaults to first element.
<nEndIndex> is the last array element to include,
defaults to all elements.
$RETURNS$
The average of the specified array elements.
$DESCRIPTION$
This function is used to get a numeric average of selected or all
elements of an array.
This routine requires FT_ASUM().
$EXAMPLES$
FT_AAVG( aSubTotals ) // Get Average of Entire Array
FT_AAVG( aSubTotals, 5 ) // Get Average of 5th Element On
FT_AAVG( aSubTotals, , 10 ) // Get Average of 1st 10 Elements
FT_AAVG( aSubTotals, 5, 10 ) // Get Average of Elements 5-10
$END$
*/

View File

@@ -2,59 +2,59 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ACCTADJ()
* $CATEGORY$
* Date/Time
* $ONELINER$
* Adjust beginning or ending fiscal pd. dates to acctg. dates
* $SYNTAX$
* FT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
* $ARGUMENTS$
* <dGivenDate> is any valid date in any valid format.
* Defaults to DATE() if not supplied.
*
* <lIsEnd> is a logical variable. .F. = adjust for beginning of
* period mode, .T. = adjust for end of period mode. Defaults to
* beginning of period mode.
* $RETURNS$
* An adjusted date dependent upon mode and work week start day.
* $DESCRIPTION$
* Called by other FT_ACCT.. functions. The algorithm is:
*
* Beginning of period mode:
*
* If dGivenDate is in last 3 days of work week
* Return next week's start date
* Else
* Return this week's start date
* Endif
*
* End of period mode:
*
* If dGivenDate is in last 4 days of work week
* Return this week's end date
* Else
* Return prior week's end date
* Endif
* $EXAMPLES$
* Beginning of period mode (lIsEnd == .F.)
*
* dDate := SToD( "19910131" ) // In last 3 days of work week
* ? FT_ACCTADJ( dDate ) // 1991.02.03 (next week's start)
*
* dDate := SToD( "19910331" ) // Not in last 3 days of work week
* ? FT_ACCTADJ( dDate ) // 1991.03.31 (this week's start)
*
* End of period mode (lIsEnd == .T.)
*
* dDate := SToD( "19910131" ) // In last 4 days of work week
* ? FT_ACCTADJ( dDate, .T. ) // 1991.02.02 (this week's end)
*
* dDate := SToD( "19910331" ) // Not in last 4 days of work week
* ? FT_ACCTADJ( dDate, .T. ) // 1991.03.30 (prior week's end)
* $SEEALSO$
* FT_DATECNFG() FT_DAYTOBOW()
* $END$
/* $DOC$
$FUNCNAME$
FT_ACCTADJ()
$CATEGORY$
Date/Time
$ONELINER$
Adjust beginning or ending fiscal pd. dates to acctg. dates
$SYNTAX$
FT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
$ARGUMENTS$
<dGivenDate> is any valid date in any valid format.
Defaults to DATE() if not supplied.
<lIsEnd> is a logical variable. .F. = adjust for beginning of
period mode, .T. = adjust for end of period mode. Defaults to
beginning of period mode.
$RETURNS$
An adjusted date dependent upon mode and work week start day.
$DESCRIPTION$
Called by other FT_ACCT.. functions. The algorithm is:
Beginning of period mode:
IF dGivenDate is in last 3 days of work week
Return next week's start date
ELSE
Return this week's start date
ENDIF
End of period mode:
IF dGivenDate is in last 4 days of work week
Return this week's end date
ELSE
Return prior week's end date
ENDIF
$EXAMPLES$
Beginning of period mode (lIsEnd == .F.)
dDate := SToD( "19910131" ) // In last 3 days of work week
? FT_ACCTADJ( dDate ) // 1991.02.03 (next week's start)
dDate := SToD( "19910331" ) // Not in last 3 days of work week
? FT_ACCTADJ( dDate ) // 1991.03.31 (this week's start)
End of period mode (lIsEnd == .T.)
dDate := SToD( "19910131" ) // In last 4 days of work week
? FT_ACCTADJ( dDate, .T. ) // 1991.02.02 (this week's end)
dDate := SToD( "19910331" ) // Not in last 4 days of work week
? FT_ACCTADJ( dDate, .T. ) // 1991.03.30 (prior week's end)
$SEEALSO$
FT_DATECNFG() FT_DAYTOBOW()
$END$
*/

View File

@@ -2,56 +2,56 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ACCTMONTH()
* $CATEGORY$
* Date/Time
* $ONELINER$
* Return accounting month data
* $SYNTAX$
* FT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
* $ARGUMENTS$
* <dGivenDate> is any valid date in any date format. Defaults
* to current system date if not supplied.
*
* <nMonthNum> is a number from 1 to 12 signifying a month.
* Defaults to current month if not supplied.
* $RETURNS$
* A three element array containing the following data:
*
* aDateInfo[ 1 ] - The year and month as a character string "YYYYMM"
* aDateInfo[ 2 ] - The beginning date of the accounting month
* aDateInfo[ 3 ] - The ending date of the accounting month
* $DESCRIPTION$
* FT_ACCTMONTH() creates an array containing data about the
* accounting month containing the given date.
*
* An accounting period has the following characteristics:
*
* If the first week of the period contains 4 or more 'work'
* days, it is included in the period; otherwise, the first
* week was included in the prior period.
*
* If the last week of the period contains 4 or more 'work'
* days it is included in the period; otherwise, the last week
* is included in the next period. This results in 13 week
* 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
* 'quarter' will contain 14 weeks and the year will contain 53
* weeks.
* $EXAMPLES$
* // get info about accounting month containing 9/15/90
* aDateInfo := FT_ACCTMONTH( SToD( "19900915" ) )
* ? aDateInfo[ 1 ] // 199009 (9th month)
* ? aDateInfo[ 2 ] // 09/02/90 beginning of month 9
* ? aDateInfo[ 3 ] // 09/29/90 end of month 9
*
* // get info about accounting month 5 in year containing 9/15/90
* aDateInfo := FT_ACCTMONTH( SToD( "19900915" ), 5 )
* ? aDateInfo[ 1 ] // 199005
* ? aDateInfo[ 2 ] // 04/29/89 beginning of month 5
* ? aDateInfo[ 3 ] // 06/02/90 end of month 5
* $SEEALSO$
* FT_DATECNFG() FT_ACCTWEEK() FT_ACCTQTR() FT_ACCTYEAR()
* $END$
/* $DOC$
$FUNCNAME$
FT_ACCTMONTH()
$CATEGORY$
Date/Time
$ONELINER$
Return accounting month data
$SYNTAX$
FT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
$ARGUMENTS$
<dGivenDate> is any valid date in any date format. Defaults
to current system date if not supplied.
<nMonthNum> is a number from 1 to 12 signifying a month.
Defaults to current month if not supplied.
$RETURNS$
A three element array containing the following data:
aDateInfo[ 1 ] - The year and month as a character string "YYYYMM"
aDateInfo[ 2 ] - The beginning date of the accounting month
aDateInfo[ 3 ] - The ending date of the accounting month
$DESCRIPTION$
FT_ACCTMONTH() creates an array containing data about the
accounting month containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
$EXAMPLES$
// get info about accounting month containing 9/15/90
aDateInfo := FT_ACCTMONTH( SToD( "19900915" ) )
? aDateInfo[ 1 ] // 199009 (9th month)
? aDateInfo[ 2 ] // 09/02/90 beginning of month 9
? aDateInfo[ 3 ] // 09/29/90 end of month 9
// get info about accounting month 5 in year containing 9/15/90
aDateInfo := FT_ACCTMONTH( SToD( "19900915" ), 5 )
? aDateInfo[ 1 ] // 199005
? aDateInfo[ 2 ] // 04/29/89 beginning of month 5
? aDateInfo[ 3 ] // 06/02/90 end of month 5
$SEEALSO$
FT_DATECNFG() FT_ACCTWEEK() FT_ACCTQTR() FT_ACCTYEAR()
$END$
*/

View File

@@ -2,56 +2,56 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ACCTQTR()
* $CATEGORY$
* Date/Time
* $ONELINER$
* Return accounting quarter data
* $SYNTAX$
* FT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
* $ARGUMENTS$
* <dGivenDate> is any valid date in any date format. Defaults
* to current system date if not supplied.
*
* <nQtrNum> is a number from 1 to 4 signifying a quarter.
* Defaults to current quarter if not supplied.
* $RETURNS$
* A three element array containing the following data:
*
* aDateInfo[ 1 ] - The year and qtr. as a character string "YYYYQQ"
* aDateInfo[ 2 ] - The beginning date of the accounting quarter
* aDateInfo[ 3 ] - The ending date of the accounting quarter
* $DESCRIPTION$
* FT_ACCTQTR() creates an array containing data about the
* accounting quarter containing the given date.
*
* An accounting period has the following characteristics:
*
* If the first week of the period contains 4 or more 'work'
* days, it is included in the period; otherwise, the first
* week was included in the prior period.
*
* If the last week of the period contains 4 or more 'work'
* days it is included in the period; otherwise, the last week
* is included in the next period. This results in 13 week
* 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
* 'quarter' will contain 14 weeks and the year will contain 53
* weeks.
* $EXAMPLES$
* // get info about accounting month containing 9/15/90
* aDateInfo := FT_ACCTQTR( SToD( "19900915" ) )
* ? aDateInfo[ 1 ] // 199003 (3rd quarter)
* ? aDateInfo[ 2 ] // 07/01/90 beginning of quarter 3
* ? aDateInfo[ 3 ] // 09/29/90 end of quarter 3
*
* // get info about accounting qtr. 2 in year containing 9/15/90
* aDateInfo := FT_ACCTQTR( SToD( "19900915" ), 2 )
* ? aDateInfo[ 1 ] // 199002
* ? aDateInfo[ 2 ] // 04/01/89 beginning of quarter 2
* ? aDateInfo[ 3 ] // 06/30/90 end of quarter 2
* $SEEALSO$
* FT_DATECNFG() FT_ACCTWEEK() FT_ACCTMONTH() FT_ACCTYEAR()
* $END$
/* $DOC$
$FUNCNAME$
FT_ACCTQTR()
$CATEGORY$
Date/Time
$ONELINER$
Return accounting quarter data
$SYNTAX$
FT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
$ARGUMENTS$
<dGivenDate> is any valid date in any date format. Defaults
to current system date if not supplied.
<nQtrNum> is a number from 1 to 4 signifying a quarter.
Defaults to current quarter if not supplied.
$RETURNS$
A three element array containing the following data:
aDateInfo[ 1 ] - The year and qtr. as a character string "YYYYQQ"
aDateInfo[ 2 ] - The beginning date of the accounting quarter
aDateInfo[ 3 ] - The ending date of the accounting quarter
$DESCRIPTION$
FT_ACCTQTR() creates an array containing data about the
accounting quarter containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
$EXAMPLES$
// get info about accounting month containing 9/15/90
aDateInfo := FT_ACCTQTR( SToD( "19900915" ) )
? aDateInfo[ 1 ] // 199003 (3rd quarter)
? aDateInfo[ 2 ] // 07/01/90 beginning of quarter 3
? aDateInfo[ 3 ] // 09/29/90 end of quarter 3
// get info about accounting qtr. 2 in year containing 9/15/90
aDateInfo := FT_ACCTQTR( SToD( "19900915" ), 2 )
? aDateInfo[ 1 ] // 199002
? aDateInfo[ 2 ] // 04/01/89 beginning of quarter 2
? aDateInfo[ 3 ] // 06/30/90 end of quarter 2
$SEEALSO$
FT_DATECNFG() FT_ACCTWEEK() FT_ACCTMONTH() FT_ACCTYEAR()
$END$
*/

View File

@@ -2,56 +2,56 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ACCTWEEK()
* $CATEGORY$
* Date/Time
* $ONELINER$
* Return accounting week data
* $SYNTAX$
* FT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
* $ARGUMENTS$
* <dGivenDate> is any valid date in any date format. Defaults
* to current system date if not supplied.
*
* <nWeekNum> is a number from 1 to 52 signifying a week.
* Defaults to current week if not supplied.
* $RETURNS$
* A three element array containing the following data:
*
* aDateInfo[ 1 ] - The year and week as a character string "YYYYWW"
* aDateInfo[ 2 ] - The beginning date of the accounting week
* aDateInfo[ 3 ] - The ending date of the accounting week
* $DESCRIPTION$
* FT_ACCTWEEK() returns an array containing data about the
* accounting week containing the given date.
*
* An accounting period has the following characteristics:
*
* If the first week of the period contains 4 or more 'work'
* days, it is included in the period; otherwise, the first
* week was included in the prior period.
*
* If the last week of the period contains 4 or more 'work'
* days it is included in the period; otherwise, the last week
* is included in the next period. This results in 13 week
* 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
* 'quarter' will contain 14 weeks and the year will contain 53
* weeks.
* $EXAMPLES$
* // get info about accounting week containing 9/15/90
* aDateInfo := FT_ACCTWEEK( SToD( "19900915" ) )
* ? aDateInfo[ 1 ] // 199037 (37th week)
* ? aDateInfo[ 2 ] // 09/09/90 beginning of week 37
* ? aDateInfo[ 3 ] // 09/15/90 end of week 37
*
* // get info about accounting week 25 in year containing 9/15/90
* aDateInfo := FT_ACCTWEEK( SToD( "19900915" ), 25 )
* ? aDateInfo[ 1 ] // 199025
* ? aDateInfo[ 2 ] // 06/17/89 beginning of week 25
* ? aDateInfo[ 3 ] // 06/23/90 end of week 25
* $SEEALSO$
* FT_DATECNFG() FT_ACCTMONTH() FT_ACCTQTR() FT_ACCTYEAR()
* $END$
/* $DOC$
$FUNCNAME$
FT_ACCTWEEK()
$CATEGORY$
Date/Time
$ONELINER$
Return accounting week data
$SYNTAX$
FT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
$ARGUMENTS$
<dGivenDate> is any valid date in any date format. Defaults
to current system date if not supplied.
<nWeekNum> is a number from 1 to 52 signifying a week.
Defaults to current week if not supplied.
$RETURNS$
A three element array containing the following data:
aDateInfo[ 1 ] - The year and week as a character string "YYYYWW"
aDateInfo[ 2 ] - The beginning date of the accounting week
aDateInfo[ 3 ] - The ending date of the accounting week
$DESCRIPTION$
FT_ACCTWEEK() returns an array containing data about the
accounting week containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
$EXAMPLES$
// get info about accounting week containing 9/15/90
aDateInfo := FT_ACCTWEEK( SToD( "19900915" ) )
? aDateInfo[ 1 ] // 199037 (37th week)
? aDateInfo[ 2 ] // 09/09/90 beginning of week 37
? aDateInfo[ 3 ] // 09/15/90 end of week 37
// get info about accounting week 25 in year containing 9/15/90
aDateInfo := FT_ACCTWEEK( SToD( "19900915" ), 25 )
? aDateInfo[ 1 ] // 199025
? aDateInfo[ 2 ] // 06/17/89 beginning of week 25
? aDateInfo[ 3 ] // 06/23/90 end of week 25
$SEEALSO$
FT_DATECNFG() FT_ACCTMONTH() FT_ACCTQTR() FT_ACCTYEAR()
$END$
*/

View File

@@ -2,47 +2,47 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ACCTYEAR()
* $CATEGORY$
* Date/Time
* $ONELINER$
* Return accounting year data
* $SYNTAX$
* FT_ACCTYEAR( [ <dGivenDate> ] ) -> aDateInfo
* $ARGUMENTS$
* <dGivenDate> is any valid date in any date format. Defaults
* to current system date if not supplied.
* $RETURNS$
* A three element array containing the following data:
*
* aDateInfo[ 1 ] - The year as a character string "YYYY"
* aDateInfo[ 2 ] - The beginning date of the accounting year
* aDateInfo[ 3 ] - The ending date of the accounting year
* $DESCRIPTION$
* FT_ACCTYEAR() creates an array containing data about the
* accounting year containing the given date.
*
* An accounting period has the following characteristics:
*
* If the first week of the period contains 4 or more 'work'
* days, it is included in the period; otherwise, the first
* week was included in the prior period.
*
* If the last week of the period contains 4 or more 'work'
* days it is included in the period; otherwise, the last week
* is included in the next period. This results in 13 week
* 'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
* 'quarter' will contain 14 weeks and the year will contain 53
* weeks.
* $EXAMPLES$
* // get info about accounting year containing 9/15/90
* aDateInfo := FT_ACCTYEAR( SToD( "19900915" ) )
* ? aDateInfo[ 1 ] // 1990
* ? aDateInfo[ 2 ] // 12/31/89 beginning of year
* ? aDateInfo[ 3 ] // 12/29/90 end of year
* $SEEALSO$
* FT_DATECNFG() FT_ACCTWEEK() FT_ACCTMONTH() FT_ACCTQTR()
* $END$
/* $DOC$
$FUNCNAME$
FT_ACCTYEAR()
$CATEGORY$
Date/Time
$ONELINER$
Return accounting year data
$SYNTAX$
FT_ACCTYEAR( [ <dGivenDate> ] ) -> aDateInfo
$ARGUMENTS$
<dGivenDate> is any valid date in any date format. Defaults
to current system date if not supplied.
$RETURNS$
A three element array containing the following data:
aDateInfo[ 1 ] - The year as a character string "YYYY"
aDateInfo[ 2 ] - The beginning date of the accounting year
aDateInfo[ 3 ] - The ending date of the accounting year
$DESCRIPTION$
FT_ACCTYEAR() creates an array containing data about the
accounting year containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
$EXAMPLES$
// get info about accounting year containing 9/15/90
aDateInfo := FT_ACCTYEAR( SToD( "19900915" ) )
? aDateInfo[ 1 ] // 1990
? aDateInfo[ 2 ] // 12/31/89 beginning of year
? aDateInfo[ 3 ] // 12/29/90 end of year
$SEEALSO$
FT_DATECNFG() FT_ACCTWEEK() FT_ACCTMONTH() FT_ACCTQTR()
$END$
*/

View File

@@ -2,46 +2,46 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ADAPTER()
* $CATEGORY$
* Video
* $ONELINER$
* Report the type of video adapter installed
* $SYNTAX$
* FT_ADAPTER() -> nResult
* $ARGUMENTS$
* None
* $RETURNS$
* Integer representing type of video adapter
*
* 0 - monochrome
* 1 - CGA
* 2 - EGA
* 3 - VGA
* $DESCRIPTION$
* This function is valuable if you use a graphics library and need to
* know what type of graphics adapter is installed.
*
* The source code is written to adhere to Turbo Assembler's IDEAL mode.
* To use another assembler, you will need to rearrange the PROC and
* SEGMENT directives, and also the ENDP and ENDS directives (a very
* minor task).
* $EXAMPLES$
* iVideo := FT_ADAPTER()
*
* DO CASE
* CASE iVideo == 0
* QOut( "You have a monochrome adapter." )
* CASE iVideo == 1
* QOut( "You have a CGA adapter." )
* CASE iVideo == 2
* QOut( "You have an EGA adapter." )
* CASE iVideo == 3
* QOut( "You have a VGA adapter." )
* ENDCASE
* $SEEALSO$
* FT_SETMODE()
* $END$
/* $DOC$
$FUNCNAME$
FT_ADAPTER()
$CATEGORY$
Video
$ONELINER$
Report the type of video adapter installed
$SYNTAX$
FT_ADAPTER() -> nResult
$ARGUMENTS$
None
$RETURNS$
Integer representing type of video adapter
0 - monochrome
1 - CGA
2 - EGA
3 - VGA
$DESCRIPTION$
This function is valuable if you use a graphics library and need to
know what type of graphics adapter is installed.
The source code is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, you will need to rearrange the PROC and
SEGMENT directives, and also the ENDP and ENDS directives (a very
minor task).
$EXAMPLES$
iVideo := FT_ADAPTER()
DO CASE
CASE iVideo == 0
QOut( "You have a monochrome adapter." )
CASE iVideo == 1
QOut( "You have a CGA adapter." )
CASE iVideo == 2
QOut( "You have an EGA adapter." )
CASE iVideo == 3
QOut( "You have a VGA adapter." )
ENDCASE
$SEEALSO$
FT_SETMODE()
$END$
*/

View File

@@ -2,34 +2,34 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ADESSORT()
* $CATEGORY$
* Array
* $ONELINER$
* Sort an array in descending order
* $SYNTAX$
* FT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> aSorted
* $ARGUMENTS$
* <aArray> is the array to be sorted
*
* <nStartIndex> is the first array item to include in the sort,
* defaults to first element
*
* <nEndIndex> is the last array element to include in the sort,
* defaults to all elements
* $RETURNS$
* The array, sorted in descending order.
* $DESCRIPTION$
* This function is used to sort an array in descending order, i.e., Z-A
* $EXAMPLES$
* FT_ADESSORT( aNames ) // Sort the Entire Array
*
* FT_ADESSORT( aNames, 5 ) // Sort from the 5th Element On
*
* FT_ADESSORT( aNames, , 10 ) // Sort the 1st 10 Elements
*
* FT_ADESSORT( aNames, 5, 10 ) // Sort Elements 5-10
* $END$
/* $DOC$
$FUNCNAME$
FT_ADESSORT()
$CATEGORY$
Array
$ONELINER$
Sort an array in descending order
$SYNTAX$
FT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> aSorted
$ARGUMENTS$
<aArray> is the array to be sorted
<nStartIndex> is the first array item to include in the sort,
defaults to first element
<nEndIndex> is the last array element to include in the sort,
defaults to all elements
$RETURNS$
The array, sorted in descending order.
$DESCRIPTION$
This function is used to sort an array in descending order, i.e., Z-A
$EXAMPLES$
FT_ADESSORT( aNames ) // Sort the Entire Array
FT_ADESSORT( aNames, 5 ) // Sort from the 5th Element On
FT_ADESSORT( aNames, , 10 ) // Sort the 1st 10 Elements
FT_ADESSORT( aNames, 5, 10 ) // Sort Elements 5-10
$END$
*/

View File

@@ -2,47 +2,47 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AEMAXLEN()
* $CATEGORY$
* Array
* $ONELINER$
* Find longest element within an array
* $SYNTAX$
* FT_AEMAXLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ;
* -> nMaxlen
* $ARGUMENTS$
* <aArray> is the array containing the elements to be measured.
*
* <nDimension> is the array dimension to be measured,
* defaults to first dimension.
*
* <nStart> is the starting array element to include,
* defaults to first array element.
*
* <nCount> is the number of array elements to process from
* from <nStart>, defaults to remaining elements
* in array.
* $RETURNS$
* The length of the longest size element of an array.
* $DESCRIPTION$
* This function will measure each element of an array
* dimension and return the longest element.
* $EXAMPLES$
* FT_AEMAXLEN( aArray ) // Measure the 1st dimension of an Array
*
* FT_AEMAXLEN( aArray, 2 ) // Measure the 2nd dimension of an Array
*
* FT_AEMAXLEN( aArray, 2, , 9 ) // Measure Elements 1-9 of the
* 2nd dimension or subarray
*
* FT_AEMAXLEN( aArray, 3, 5, 9 ) // Measure Elements 5-9 of the
* 3rd dimension or subarray
*
* FT_AEMAXLEN( aArray, 3, 5 ) // Measure Elements 5 to last in the
* 3rd dimension or subarray
* $SEEALSO$
* FT_AEMINLEN()
* $END$
/* $DOC$
$FUNCNAME$
FT_AEMAXLEN()
$CATEGORY$
Array
$ONELINER$
Find longest element within an array
$SYNTAX$
FT_AEMAXLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ;
-> nMaxlen
$ARGUMENTS$
<aArray> is the array containing the elements to be measured.
<nDimension> is the array dimension to be measured,
defaults to first dimension.
<nStart> is the starting array element to include,
defaults to first array element.
<nCount> is the number of array elements to process from
from <nStart>, defaults to remaining elements
in array.
$RETURNS$
The length of the longest size element of an array.
$DESCRIPTION$
This function will measure each element of an array
dimension and return the longest element.
$EXAMPLES$
FT_AEMAXLEN( aArray ) // Measure the 1st dimension of an Array
FT_AEMAXLEN( aArray, 2 ) // Measure the 2nd dimension of an Array
FT_AEMAXLEN( aArray, 2, , 9 ) // Measure Elements 1-9 of the
2nd dimension or subarray
FT_AEMAXLEN( aArray, 3, 5, 9 ) // Measure Elements 5-9 of the
3rd dimension or subarray
FT_AEMAXLEN( aArray, 3, 5 ) // Measure Elements 5 to last in the
3rd dimension or subarray
$SEEALSO$
FT_AEMINLEN()
$END$
*/

View File

@@ -2,44 +2,44 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AEMINLEN()
* $CATEGORY$
* Array
* $ONELINER$
* Find shortest element within an array
* $SYNTAX$
* FT_AEMINLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] )
* -> nMinlen
* $ARGUMENTS$
* <aArray> is the array containing the elements to be measured.
*
* <nDimension> is the array dimension to be measured,
* defaults to first dimension.
*
* <nStart> is the starting array element to include,
* defaults to first array element.
*
* <nCount> is the number of array elements to process from
* from <nStart>, defaults to remaining elements
* in array.
* $RETURNS$
* The length of the shortest size element of an array.
* $DESCRIPTION$
* This function will measure each element of an array
* dimension and return the shortest element.
* $EXAMPLES$
* FT_AEMINLEN( aArray ) // Measure the 1st dimension of an Array
*
* FT_AEMINLEN( aArray, 2 ) // Measure the 2nd dimension of an Array
*
* FT_AEMINLEN( aArray, 2, , 9 ) // Measure Elements 1-9 of 2nd dimension
*
* FT_AEMINLEN( aArray, 3, 5, 9 ) // Measure Elements 5-9 of 3rd dimension
*
* FT_AEMINLEN( aArray, 3, 5 ) // Measure Elements 5 to end of 3rd dimension
* $SEEALSO$
* FT_AEMAXLEN()
* $END$
/* $DOC$
$FUNCNAME$
FT_AEMINLEN()
$CATEGORY$
Array
$ONELINER$
Find shortest element within an array
$SYNTAX$
FT_AEMINLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] )
-> nMinlen
$ARGUMENTS$
<aArray> is the array containing the elements to be measured.
<nDimension> is the array dimension to be measured,
defaults to first dimension.
<nStart> is the starting array element to include,
defaults to first array element.
<nCount> is the number of array elements to process from
from <nStart>, defaults to remaining elements
in array.
$RETURNS$
The length of the shortest size element of an array.
$DESCRIPTION$
This function will measure each element of an array
dimension and return the shortest element.
$EXAMPLES$
FT_AEMINLEN( aArray ) // Measure the 1st dimension of an Array
FT_AEMINLEN( aArray, 2 ) // Measure the 2nd dimension of an Array
FT_AEMINLEN( aArray, 2, , 9 ) // Measure Elements 1-9 of 2nd dimension
FT_AEMINLEN( aArray, 3, 5, 9 ) // Measure Elements 5-9 of 3rd dimension
FT_AEMINLEN( aArray, 3, 5 ) // Measure Elements 5 to end of 3rd dimension
$SEEALSO$
FT_AEMAXLEN()
$END$
*/

View File

@@ -2,29 +2,29 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ALT()
* $CATEGORY$
* Keyboard/Mouse
* $ONELINER$
* Determine status of the Alt key
* $SYNTAX$
* FT_ALT() -> lValue
* $ARGUMENTS$
* None
* $RETURNS$
* .T. if Alt key is pressed, .F. if otherwise.
* $DESCRIPTION$
* This function is useful for times you need to know whether or not the
* Alt key is pressed, such as during a MemoEdit().
* $EXAMPLES$
* IF FT_ALT()
* @ 24, 0 SAY "Alt"
* ELSE
* @ 24, 0 SAY " "
* ENDIF
* $SEEALSO$
* FT_CAPLOCK() FT_CTRL() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT()
* $END$
/* $DOC$
$FUNCNAME$
FT_ALT()
$CATEGORY$
Keyboard/Mouse
$ONELINER$
Determine status of the Alt key
$SYNTAX$
FT_ALT() -> lValue
$ARGUMENTS$
None
$RETURNS$
.T. if Alt key is pressed, .F. if otherwise.
$DESCRIPTION$
This function is useful for times you need to know whether or not the
Alt key is pressed, such as during a MemoEdit().
$EXAMPLES$
IF FT_ALT()
@ 24, 0 SAY "Alt"
ELSE
@ 24, 0 SAY " "
ENDIF
$SEEALSO$
FT_CAPLOCK() FT_CTRL() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT()
$END$
*/

View File

@@ -2,41 +2,41 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AMEDIAN()
* $CATEGORY$
* Array
* $ONELINER$
* Find middle value in array, or average of two middle values
* $SYNTAX$
* FT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] )
* -> nMedian
* $ARGUMENTS$
* <aArray> is the array containing the elements to be averaged.
*
* <nStart> is the first array element to include,
* defaults to first element.
*
* <nEnd> is the last array element to include,
* defaults to last element.
* $RETURNS$
* The median average of the array elements
* $DESCRIPTION$
* This function sorts the elements of a numeric array and
* then returns the value in the middle element of the sorted
* array. If there is no exact middle value, then it returns
* the average of the two middle values. Half of the elements
* are > median and half are < median. A median average may
* more reflect a more useful average when there are extreme
* values in the set.
* $EXAMPLES$
* FT_AMEDIAN( aArray ) // Return Median for entire array
*
* FT_AMEDIAN( aArray, 2 ) // Return Median for elements from 2 to end
*
* FT_AMEDIAN( aArray, , 9 ) // Return Median for 1st 9 elements
*
* FT_AMEDIAN( aArray, 8, 40 ) // Return Median for elements 8 to 40
* $END$
/* $DOC$
$FUNCNAME$
FT_AMEDIAN()
$CATEGORY$
Array
$ONELINER$
Find middle value in array, or average of two middle values
$SYNTAX$
FT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] )
-> nMedian
$ARGUMENTS$
<aArray> is the array containing the elements to be averaged.
<nStart> is the first array element to include,
defaults to first element.
<nEnd> is the last array element to include,
defaults to last element.
$RETURNS$
The median average of the array elements
$DESCRIPTION$
This function sorts the elements of a numeric array and
then returns the value in the middle element of the sorted
array. If there is no exact middle value, then it returns
the average of the two middle values. Half of the elements
are > median and half are < median. A median average may
more reflect a more useful average when there are extreme
values in the set.
$EXAMPLES$
FT_AMEDIAN( aArray ) // Return Median for entire array
FT_AMEDIAN( aArray, 2 ) // Return Median for elements from 2 to end
FT_AMEDIAN( aArray, , 9 ) // Return Median for 1st 9 elements
FT_AMEDIAN( aArray, 8, 40 ) // Return Median for elements 8 to 40
$END$
*/

View File

@@ -2,45 +2,45 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ANOMATCHES()
* $CATEGORY$
* Array
* $ONELINER$
* Find the number of array elements meeting a condition
* $SYNTAX$
* FT_ANOMATCHES( <aArray>, <bCompareBlock> ;
* [, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches
* $ARGUMENTS$
* <aArray> is the array to be searched
*
* <bCompareBlock> is a code block containing the expression for
* the array elements to be tested with. Each element is passed
* as a parameter to the block. If the block returns .T., the
* number of matches will be incremented by one.
*
* <nStartIndex> is the first array item to include in the search,
* defaults to first element.
*
* <nEndIndex> is the last array element to include in the search,
* defaults to all elements.
* $RETURNS$
* The number of elements that cause the code block to return .T.
* $DESCRIPTION$
* This function returns the number of array elements that, when passed
* to the supplied code block, cause that code block to return a .T. value.
* $EXAMPLES$
* // Search the Entire Array
* FT_ANOMATCHES( aTries, {| x | x <= 100 } )
*
* // Search from the 5th Element On
* FT_ANOMATCHES( aCodes, {| x | Upper( x ) == cCurrentCode }, 5 )
*
* // Search the 1st 10 Elements
* FT_ANOMATCHES( aDates, {| x | IS_BETWEEN( Date() - 7, x, Date() + 7 ) }, 10 )
*
* // Search Elements 5-10
* FT_ANOMATCHES( aNames, {| x | x <= cLastGoodName }, 5, 10 )
* $END$
/* $DOC$
$FUNCNAME$
FT_ANOMATCHES()
$CATEGORY$
Array
$ONELINER$
Find the number of array elements meeting a condition
$SYNTAX$
FT_ANOMATCHES( <aArray>, <bCompareBlock> ;
[, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches
$ARGUMENTS$
<aArray> is the array to be searched
<bCompareBlock> is a code block containing the expression for
the array elements to be tested with. Each element is passed
as a parameter to the block. If the block returns .T., the
number of matches will be incremented by one.
<nStartIndex> is the first array item to include in the search,
defaults to first element.
<nEndIndex> is the last array element to include in the search,
defaults to all elements.
$RETURNS$
The number of elements that cause the code block to return .T.
$DESCRIPTION$
This function returns the number of array elements that, when passed
to the supplied code block, cause that code block to return a .T. value.
$EXAMPLES$
// Search the Entire Array
FT_ANOMATCHES( aTries, {| x | x <= 100 } )
// Search from the 5th Element On
FT_ANOMATCHES( aCodes, {| x | Upper( x ) == cCurrentCode }, 5 )
// Search the 1st 10 Elements
FT_ANOMATCHES( aDates, {| x | IS_BETWEEN( Date() - 7, x, Date() + 7 ) }, 10 )
// Search Elements 5-10
FT_ANOMATCHES( aNames, {| x | x <= cLastGoodName }, 5, 10 )
$END$
*/

View File

@@ -2,35 +2,35 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_XTOY()
* $CATEGORY$
* Conversion
* $ONELINER$
* Convert from any data type to any other data type
* $SYNTAX$
* FT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ;
* [, <lWantYesNo> ] ) -> xResult
* $ARGUMENTS$
* <xValueToConvert> is the value to convert.
*
* <cTypeToConvertTo> is the type of value to convert to
* ("C","D","L","N","A" or "B").
*
* <lWantYesNo> is a logical to signal if 'Y' or 'N' is to be returned
* if Converting a logical, otherwise '.T.' or '.F.' will be returned
* for logicals.
* $RETURNS$
* The original value converted to the new type.
* $DESCRIPTION$
* This function converts a value of character, date, numeric, logical,
* array or code block type to any of the other type. While it is
* guaranteed to return a value of the correct type, that value may not
* be meaningful (i.e., converting from a code block returns an EMPTY()
* value of the desired type).
* $EXAMPLES$
* nNumericValue := FT_XTOY( cInputValue, "N" )
* IF FT_XTOY( nInputValue, "L" )
* $END$
/* $DOC$
$FUNCNAME$
FT_XTOY()
$CATEGORY$
Conversion
$ONELINER$
Convert from any data type to any other data type
$SYNTAX$
FT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ;
[, <lWantYesNo> ] ) -> xResult
$ARGUMENTS$
<xValueToConvert> is the value to convert.
<cTypeToConvertTo> is the type of value to convert to
("C","D","L","N","A" or "B").
<lWantYesNo> is a logical to signal if 'Y' or 'N' is to be returned
if Converting a logical, otherwise '.T.' or '.F.' will be returned
for logicals.
$RETURNS$
The original value converted to the new type.
$DESCRIPTION$
This function converts a value of character, date, numeric, logical,
array or code block type to any of the other type. While it is
guaranteed to return a value of the correct type, that value may not
be meaningful (i.e., converting from a code block returns an EMPTY()
value of the desired type).
$EXAMPLES$
nNumericValue := FT_XTOY( cInputValue, "N" )
IF FT_XTOY( nInputValue, "L" )
$END$
*/

View File

@@ -2,74 +2,74 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AREDIT()
* $CATEGORY$
* Array
* $ONELINER$
* 2 dimensional array editing function using TBrowse
* $SYNTAX$
* FT_AREDIT( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ;
* <nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) -> xElement
* $ARGUMENTS$
* <nTop>, <nLeft>, <nBottom>, <nRight> are coordinates for TBrowse
*
* <Array Name> is name of 2 dimensional to array edit
*
* <nElem> is pointer for element in array
*
* <aHeadings> is array of column headings
*
* <aBlocks> is array of blocks describing each array element
*
* [ <bGetFunc> ] is get editing function for handling individual elements
* $RETURNS$
* Value of element positioned on when exit FT_AREDIT()
* The type of this value depends on what is displayed.
* $DESCRIPTION$
* This function allows you to position yourself in an array,
* add and delete rows with the <F7> and <F8> keys,
* and pass a UDF with information to edit the individual gets.
* $EXAMPLES$
* FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks)
*
* This example will allow you to browse a 2 dimensional array
* But you can't edit it since there is no GetBlock UDF
* It allows the user to hit ENTER to select an element or ESC to
* return 0
*
* * This second example shows how to edit a 2 dimensional array
* * as might be done to edit an invoice
*
* LOCAL i, ar[ 3, 26 ], aBlocks[ 3 ], aHeadings[ 3 ]
* LOCAL nElem := 1, bGetFunc
*
* * Set up two dimensional array "ar"
*
* FOR i := 1 TO 26
* ar[ 1, i ] := i // 1 -> 26 Numeric
* ar[ 2, i ] := Chr( Asc( "A" ) + i - 1 ) // "A" -> "Z" Character
* ar[ 3, i ] := Chr( Asc( "Z" ) - i + 1 ) // "Z" -> "A" Character
* NEXT
*
* * SET UP aHeadings Array for column headings
*
* aHeadings := { "Numbers", "Letters", "Reverse" }
*
* * Need to set up individual array blocks for each TBrowse column
*
* aBlocks[ 1 ] := {|| Str( ar[ 1, nElem ], 2 ) } // prevent default 10 spaces
* aBlocks[ 2 ] := {|| ar[ 2, nElem ] }
* aBlocks[ 3 ] := {|| ar[ 3, nElem ] }
*
* * set up TestGet() as the passed Get Function so FT_ArEdit knows how
* * to edit the individual gets.
*
* bGetFunc := {| b, ar, nDim, nElem | TestGet( b, ar, nDim, nElem ) }
* SetColor( "N/W, W/N, , , W/N" )
* CLS
* FT_AREDIT( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc )
*
* $END$
/* $DOC$
$FUNCNAME$
FT_AREDIT()
$CATEGORY$
Array
$ONELINER$
2 dimensional array editing function using TBrowse
$SYNTAX$
FT_AREDIT( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ;
<nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) -> xElement
$ARGUMENTS$
<nTop>, <nLeft>, <nBottom>, <nRight> are coordinates for TBrowse
<Array Name> is name of 2 dimensional to array edit
<nElem> is pointer for element in array
<aHeadings> is array of column headings
<aBlocks> is array of blocks describing each array element
[ <bGetFunc> ] is get editing function for handling individual elements
$RETURNS$
Value of element positioned on when exit FT_AREDIT()
The type of this value depends on what is displayed.
$DESCRIPTION$
This function allows you to position yourself in an array,
add and delete rows with the <F7> and <F8> keys,
and pass a UDF with information to edit the individual gets.
$EXAMPLES$
FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks)
This example will allow you to browse a 2 dimensional array
But you can't edit it since there is no GetBlock UDF
It allows the user to hit ENTER to select an element or ESC to
return 0
* This second example shows how to edit a 2 dimensional array
* as might be done to edit an invoice
LOCAL i, ar[ 3, 26 ], aBlocks[ 3 ], aHeadings[ 3 ]
LOCAL nElem := 1, bGetFunc
* Set up two dimensional array "ar"
FOR i := 1 TO 26
ar[ 1, i ] := i // 1 -> 26 Numeric
ar[ 2, i ] := Chr( Asc( "A" ) + i - 1 ) // "A" -> "Z" Character
ar[ 3, i ] := Chr( Asc( "Z" ) - i + 1 ) // "Z" -> "A" Character
NEXT
* SET UP aHeadings Array for column headings
aHeadings := { "Numbers", "Letters", "Reverse" }
* Need to set up individual array blocks for each TBrowse column
aBlocks[ 1 ] := {|| Str( ar[ 1, nElem ], 2 ) } // prevent default 10 spaces
aBlocks[ 2 ] := {|| ar[ 2, nElem ] }
aBlocks[ 3 ] := {|| ar[ 3, nElem ] }
* set up TestGet() as the passed Get Function so FT_ArEdit knows how
* to edit the individual gets.
bGetFunc := {| b, ar, nDim, nElem | TestGet( b, ar, nDim, nElem ) }
SetColor( "N/W, W/N, , , W/N" )
CLS
FT_AREDIT( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc )
$END$
*/

View File

@@ -2,35 +2,35 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ASUM()
* $CATEGORY$
* Array
* $ONELINER$
* Sum the elements of an array
* $SYNTAX$
* FT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nSum
* $ARGUMENTS$
* <aArray> is the array containing the elements to be summed.
*
* <nStartIndex> is the first array item to include,
* defaults to first element.
*
* <nEndIndex> is the last array element to include,
* defaults to all elements.
* $RETURNS$
* The sum of the elements of the array or the lengths of the elements.
* $DESCRIPTION$
* This function is to sum the elements of a numeric array or to sum the
* lengths of a character array.
* $EXAMPLES$
* FT_ASUM( aSubTotals ) // Sum the Entire Array
*
* FT_ASUM( aSubTotals, 5 ) // Sum from the 5th Element On
*
* FT_ASUM( aSubTotals, , 10 ) // Sum the 1st 10 Elements
*
* FT_ASUM( aSubTotals, 5, 10 ) // Sum Elements 5-10
* $END$
/* $DOC$
$FUNCNAME$
FT_ASUM()
$CATEGORY$
Array
$ONELINER$
Sum the elements of an array
$SYNTAX$
FT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nSum
$ARGUMENTS$
<aArray> is the array containing the elements to be summed.
<nStartIndex> is the first array item to include,
defaults to first element.
<nEndIndex> is the last array element to include,
defaults to all elements.
$RETURNS$
The sum of the elements of the array or the lengths of the elements.
$DESCRIPTION$
This function is to sum the elements of a numeric array or to sum the
lengths of a character array.
$EXAMPLES$
FT_ASUM( aSubTotals ) // Sum the Entire Array
FT_ASUM( aSubTotals, 5 ) // Sum from the 5th Element On
FT_ASUM( aSubTotals, , 10 ) // Sum the 1st 10 Elements
FT_ASUM( aSubTotals, 5, 10 ) // Sum Elements 5-10
$END$
*/

View File

@@ -2,80 +2,80 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_AT2()
* $CATEGORY$
* String
* $ONELINER$
* Find position of the nth occurrence of a substring
* $SYNTAX$
* FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
* $ARGUMENTS$
* <cSearch> is the character substring to search for.
*
* <cTarget> is the character string to search.
*
* <nOccurs> is the occurrence of cSearch to look for,
* defaults to 1.
*
* <lCaseSens> is a logical value denoting case sensitivity.
* If .F., then search is NOT sensitive to case,
* defaults to .T.
* $RETURNS$
* The position of the nth occurrence of a substring
* $DESCRIPTION$
* This function will find the nth occurrence of a substring
* within a string.
* $EXAMPLES$
* cSearch := "t"
* cTarget := "This is the day that the Lord has made."
*
* FT_AT2( cSearch, cTarget ) // Returns ( 9 )
*
* FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )
*
* FT_AT2( cSearch, cTarget, 2, .F. ) // Returns ( 9 )
* $SEEALSO$
* FT_FINDITH(), FT_RAT2()
* $END$
/* $DOC$
$FUNCNAME$
FT_AT2()
$CATEGORY$
String
$ONELINER$
Find position of the nth occurrence of a substring
$SYNTAX$
FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
$ARGUMENTS$
<cSearch> is the character substring to search for.
<cTarget> is the character string to search.
<nOccurs> is the occurrence of cSearch to look for,
defaults to 1.
<lCaseSens> is a logical value denoting case sensitivity.
If .F., then search is NOT sensitive to case,
defaults to .T.
$RETURNS$
The position of the nth occurrence of a substring
$DESCRIPTION$
This function will find the nth occurrence of a substring
within a string.
$EXAMPLES$
cSearch := "t"
cTarget := "This is the day that the Lord has made."
FT_AT2( cSearch, cTarget ) // Returns ( 9 )
FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )
FT_AT2( cSearch, cTarget, 2, .F. ) // Returns ( 9 )
$SEEALSO$
FT_FINDITH(), FT_RAT2()
$END$
*/
/* $DOC$
* $FUNCNAME$
* FT_RAT2()
* $CATEGORY$
* String
* $ONELINER$
* Find position of the reversed nth occurrence of a substring
* $SYNTAX$
* FT_RAT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
* $ARGUMENTS$
* <cSearch> is the character substring to search for.
*
* <cTarget> is the character string to search.
*
* <nOccurs> is the occurrence of cSearch to look for,
* defaults to 1.
*
* <lCaseSens> is a logical value denoting case sensitivity.
* If .F., then search is NOT sensitive to case,
* defaults to .T.
* $RETURNS$
* The position of the nth occurrence of a reversed substring
* $DESCRIPTION$
* This function will find the nth occurrence of a reversed
* substring within a string.
* $EXAMPLES$
* cSearch := "t"
* cTarget := "This is the day that the Lord has made."
*
* FT_RAT2( cSearch, cTarget ) // Returns ( 22 )
*
* FT_RAT2( cSearch, cTarget, 2 ) // Returns ( 20 )
*
* FT_RAT2( cSearch, cTarget, 2, .F. ) // Returns ( 22 )
* $SEEALSO$
* FT_FINDITH(), FT_AT2()
* $END$
/* $DOC$
$FUNCNAME$
FT_RAT2()
$CATEGORY$
String
$ONELINER$
Find position of the reversed nth occurrence of a substring
$SYNTAX$
FT_RAT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
$ARGUMENTS$
<cSearch> is the character substring to search for.
<cTarget> is the character string to search.
<nOccurs> is the occurrence of cSearch to look for,
defaults to 1.
<lCaseSens> is a logical value denoting case sensitivity.
If .F., then search is NOT sensitive to case,
defaults to .T.
$RETURNS$
The position of the nth occurrence of a reversed substring
$DESCRIPTION$
This function will find the nth occurrence of a reversed
substring within a string.
$EXAMPLES$
cSearch := "t"
cTarget := "This is the day that the Lord has made."
FT_RAT2( cSearch, cTarget ) // Returns ( 22 )
FT_RAT2( cSearch, cTarget, 2 ) // Returns ( 20 )
FT_RAT2( cSearch, cTarget, 2, .F. ) // Returns ( 22 )
$SEEALSO$
FT_FINDITH(), FT_AT2()
$END$
*/

View File

@@ -2,44 +2,44 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BITCLR()
* $CATEGORY$
* String
* $ONELINER$
* Clear (reset) selected bit in a byte
* $SYNTAX$
* FT_BITCLR( <cByte>, <nBitPos> ) -> cByte
* $ARGUMENTS$
* <cByte> is a character from Chr(0) to Chr(255).
*
* <nBitPos> is a number from 0 to 7 conforming to standard
* right-to-left bit numbering convention and representing the
* position of the bit within the byte.
* $RETURNS$
* Returns new byte, with designated bit cleared (reset).
* If parameters are faulty, returns NIL.
* $DESCRIPTION$
* In effect, ANDs argument byte with a byte that has all bits set except
* the target bit. If bit is already clear (0), it remains clear.
* Note: Calls FT_ISBIT() which is also in this Library.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code would clear bit 4 in a byte represented by Chr( 115 ):
*
* cNewByte := FT_BITCLR( Chr( 115 ), 4 )
* ? Asc( cNewbyte ) // result: 99
* ? cNewByte // result: "c"
*
* This code would clear bit 5 in the byte represented by letter "A":
*
* FT_BITCLR( "A", 5 ) // result: "A", since
* // bit 5 already clear
* $SEEALSO$
* FT_BITSET() FT_ISBIT()
* $END$
/* $DOC$
$FUNCNAME$
FT_BITCLR()
$CATEGORY$
String
$ONELINER$
Clear (reset) selected bit in a byte
$SYNTAX$
FT_BITCLR( <cByte>, <nBitPos> ) -> cByte
$ARGUMENTS$
<cByte> is a character from Chr(0) to Chr(255).
<nBitPos> is a number from 0 to 7 conforming to standard
right-to-left bit numbering convention and representing the
position of the bit within the byte.
$RETURNS$
Returns new byte, with designated bit cleared (reset).
If parameters are faulty, returns NIL.
$DESCRIPTION$
In effect, ANDs argument byte with a byte that has all bits set except
the target bit. If bit is already clear (0), it remains clear.
Note: Calls FT_ISBIT() which is also in this Library.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code would clear bit 4 in a byte represented by Chr( 115 ):
cNewByte := FT_BITCLR( Chr( 115 ), 4 )
? Asc( cNewbyte ) // result: 99
? cNewByte // result: "c"
This code would clear bit 5 in the byte represented by letter "A":
FT_BITCLR( "A", 5 ) // result: "A", since
// bit 5 already clear
$SEEALSO$
FT_BITSET() FT_ISBIT()
$END$
*/

View File

@@ -2,45 +2,45 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BITSET()
* $CATEGORY$
* String
* $ONELINER$
* Set selected bit in a byte
* $SYNTAX$
* FT_BITSET( <cByte>, <nBitPos> ) -> cByte
* $ARGUMENTS$
* <cByte> is a character from Chr(0) to Chr(255).
*
* <nBitPos> is a number from 0 to 7 conforming to standard right-to-left
* bit numbering convention and representing the position of the bit
* within the byte.
* $RETURNS$
* Returns new byte, with designated bit set. If parameters are faulty,
* returns NIL.
* $DESCRIPTION$
* In effect, ORs argument byte with a byte that has only the target bit
* set. If bit is already set, it remains set.
* Note: Calls FT_ISBIT() which is also in this Library.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code would set bit 4 in a byte represented by Chr( 107 ):
*
* cNewbyte := FT_BITSET( Chr( 107 ), 4 )
* ? Asc( cNewbyte ) // result: 123
* ? cNewbyte // result: "{"
*
*
* This code would set bit 5 in the byte represented by the letter "A".
*
* ? FT_BITSET( "A", 5 ) // result: "a"
* // bit 5 set
* $SEEALSO$
* FT_BITCLR() FT_ISBIT()
* $END$
/* $DOC$
$FUNCNAME$
FT_BITSET()
$CATEGORY$
String
$ONELINER$
Set selected bit in a byte
$SYNTAX$
FT_BITSET( <cByte>, <nBitPos> ) -> cByte
$ARGUMENTS$
<cByte> is a character from Chr(0) to Chr(255).
<nBitPos> is a number from 0 to 7 conforming to standard right-to-left
bit numbering convention and representing the position of the bit
within the byte.
$RETURNS$
Returns new byte, with designated bit set. If parameters are faulty,
returns NIL.
$DESCRIPTION$
In effect, ORs argument byte with a byte that has only the target bit
set. If bit is already set, it remains set.
Note: Calls FT_ISBIT() which is also in this Library.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code would set bit 4 in a byte represented by Chr( 107 ):
cNewbyte := FT_BITSET( Chr( 107 ), 4 )
? Asc( cNewbyte ) // result: 123
? cNewbyte // result: "{"
This code would set bit 5 in the byte represented by the letter "A".
? FT_BITSET( "A", 5 ) // result: "a"
// bit 5 set
$SEEALSO$
FT_BITCLR() FT_ISBIT()
$END$
*/

View File

@@ -2,30 +2,30 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BLINK()
* $CATEGORY$
* Menus/Prompts
* $ONELINER$
* Display a blinking message on the screen
* $SYNTAX$
* FT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
* $ARGUMENTS$
* <cMsg> is the string to blink.
*
* <nRow> is an optional screen row for @...SAY, default current.
*
* <nCol> is an optional screen col for @...say, default current.
* $RETURNS$
* NIL
* $DESCRIPTION$
* A quick way to blink a msg on screen in the CURRENT colors.
* Restores colors on return.
* $EXAMPLES$
* FT_BLINK( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10
*
* @ 5,10 SAY "WAIT - Printing Report"
* FT_BLINK( "..." ) // Blink "..." after wait message...
* $END$
/* $DOC$
$FUNCNAME$
FT_BLINK()
$CATEGORY$
Menus/Prompts
$ONELINER$
Display a blinking message on the screen
$SYNTAX$
FT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
$ARGUMENTS$
<cMsg> is the string to blink.
<nRow> is an optional screen row for @...SAY, default current.
<nCol> is an optional screen col for @...say, default current.
$RETURNS$
NIL
$DESCRIPTION$
A quick way to blink a msg on screen in the CURRENT colors.
Restores colors on return.
$EXAMPLES$
FT_BLINK( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10
@ 5,10 SAY "WAIT - Printing Report"
FT_BLINK( "..." ) // Blink "..." after wait message...
$END$
*/

View File

@@ -2,41 +2,41 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYT2BIT()
* $CATEGORY$
* Conversion
* $ONELINER$
* Convert byte to string of 1's and 0's
* $SYNTAX$
* FT_BYT2BIT( <cByte> ) -> cBitPattern
* $ARGUMENTS$
* <cByte> is the byte to convert.
* $RETURNS$
* 9-character string, consisting of 1's and 0's, representing bits 0
* through 7 of parameter byte, with space between bits 3 and 4. Returns
* NIL if parameters are faulty.
* $DESCRIPTION$
* Can be used to show results of bit manipulation, both before and after.
* Binary representation follows right-to-left convention of bit position
* numbering, 0 through 7. Space between high and low nibbles for clarity
* and easy comparison to hexadecimal notation.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* These three code lines perform a bitwise AND on bytes with values of
* Chr(20) and Chr(36), and deliver the result as a string in binary (bit)
* format.
*
* ? FT_BYT2BIT( Chr( 20 ) ) // byte1: '0001 0100'
* ? FT_BYT2BIT( Chr( 36 ) ) // byte2: '0010 0100'
*
* ? FT_BYT2BIT( FT_BYTEAND( Chr( 20 ), Chr( 36 ) ) )
* // result: '0000 0100'
* $SEEALSO$
* FT_BYT2HEX()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYT2BIT()
$CATEGORY$
Conversion
$ONELINER$
Convert byte to string of 1's and 0's
$SYNTAX$
FT_BYT2BIT( <cByte> ) -> cBitPattern
$ARGUMENTS$
<cByte> is the byte to convert.
$RETURNS$
9-character string, consisting of 1's and 0's, representing bits 0
through 7 of parameter byte, with space between bits 3 and 4. Returns
NIL if parameters are faulty.
$DESCRIPTION$
Can be used to show results of bit manipulation, both before and after.
Binary representation follows right-to-left convention of bit position
numbering, 0 through 7. Space between high and low nibbles for clarity
and easy comparison to hexadecimal notation.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
These three code lines perform a bitwise AND on bytes with values of
Chr(20) and Chr(36), and deliver the result as a string in binary (bit)
format.
? FT_BYT2BIT( Chr( 20 ) ) // byte1: '0001 0100'
? FT_BYT2BIT( Chr( 36 ) ) // byte2: '0010 0100'
? FT_BYT2BIT( FT_BYTEAND( Chr( 20 ), Chr( 36 ) ) )
// result: '0000 0100'
$SEEALSO$
FT_BYT2HEX()
$END$
*/

View File

@@ -2,38 +2,38 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYT2HEX()
* $CATEGORY$
* Conversion
* $ONELINER$
* Convert byte to hexadecimal version of its binary value
* $SYNTAX$
* FT_BYT2HEX( cByte ) -> cHexValue
* $ARGUMENTS$
* <cByte> is the byte to convert.
* $RETURNS$
* Three-character string, consisting of two digits of hexadecimal
* notation and letter 'h' to signify hex. Returns NIL if parameters are
* faulty.
* $DESCRIPTION$
* Can be used to show results of bit manipulation, both before and after.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* These three code lines perform a bitwise AND on bytes with values of
* Chr(20) and Chr(36), and deliver the result as a string in hexadecimal
* format, using 'h' to signify hexadecimal.
*
* ? FT_BYT2HEX( Chr( 20 ) ) // byte1: '14h'
* ? FT_BYT2HEX( Chr( 36 ) ) // byte2: '24h'
*
* ? FT_BYT2HEX( FT_BYTEAND( Chr( 20 ), Chr( 36 ) ) )
* // result: '04h'
* $SEEALSO$
* FT_BYT2BIT()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYT2HEX()
$CATEGORY$
Conversion
$ONELINER$
Convert byte to hexadecimal version of its binary value
$SYNTAX$
FT_BYT2HEX( cByte ) -> cHexValue
$ARGUMENTS$
<cByte> is the byte to convert.
$RETURNS$
Three-character string, consisting of two digits of hexadecimal
notation and letter 'h' to signify hex. Returns NIL if parameters are
faulty.
$DESCRIPTION$
Can be used to show results of bit manipulation, both before and after.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
These three code lines perform a bitwise AND on bytes with values of
Chr(20) and Chr(36), and deliver the result as a string in hexadecimal
format, using 'h' to signify hexadecimal.
? FT_BYT2HEX( Chr( 20 ) ) // byte1: '14h'
? FT_BYT2HEX( Chr( 36 ) ) // byte2: '24h'
? FT_BYT2HEX( FT_BYTEAND( Chr( 20 ), Chr( 36 ) ) )
// result: '04h'
$SEEALSO$
FT_BYT2BIT()
$END$
*/

View File

@@ -2,38 +2,38 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYTEAND()
* $CATEGORY$
* String
* $ONELINER$
* Perform bit-wise AND on two ASCII characters (bytes)
* $SYNTAX$
* FT_BYTEAND( <cByte1>, <cByte2> ) -> cByte
* $ARGUMENTS$
* <cByte1> and <cByte2> are characters from Chr(0) TO Chr(255).
* May be passed in Chr() form, as character literals, or as expressions
* evaluating to Chr() values.
* $RETURNS$
* Returns resulting byte, in Chr() form. If parameters are faulty,
* returns NIL.
* $DESCRIPTION$
* Can be used for any bit-wise masking operation. In effect, this is a
* bit-by-bit AND operation. Equivalent to AND assembler instruction.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code would mask out the high nibble (four most significant bits)
* of the byte represented by Chr(123) and leave the low nibble bits as in
* the parameter byte.
*
* cNewbyte := FT_BYTEAND( Chr( 123 ), Chr( 15 ) )
* ? Asc( cNewByte ) // result: 11
* ? cNewByte // result: non-printable character
* $SEEALSO$
* FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYTEAND()
$CATEGORY$
String
$ONELINER$
Perform bit-wise AND on two ASCII characters (bytes)
$SYNTAX$
FT_BYTEAND( <cByte1>, <cByte2> ) -> cByte
$ARGUMENTS$
<cByte1> and <cByte2> are characters from Chr(0) TO Chr(255).
May be passed in Chr() form, as character literals, or as expressions
evaluating to Chr() values.
$RETURNS$
Returns resulting byte, in Chr() form. If parameters are faulty,
returns NIL.
$DESCRIPTION$
Can be used for any bit-wise masking operation. In effect, this is a
bit-by-bit AND operation. Equivalent to AND assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code would mask out the high nibble (four most significant bits)
of the byte represented by Chr(123) and leave the low nibble bits as in
the parameter byte.
cNewbyte := FT_BYTEAND( Chr( 123 ), Chr( 15 ) )
? Asc( cNewByte ) // result: 11
? cNewByte // result: non-printable character
$SEEALSO$
FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG()
$END$
*/

View File

@@ -2,36 +2,36 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYTENEG()
* $CATEGORY$
* String
* $ONELINER$
* Perform bit-wise negation on an ASCII character
* $SYNTAX$
* FT_BYTENEG( <cByte> ) -> cNewByte
* $ARGUMENTS$
* <cByte> is a character from Chr(0) to Chr(255).
* May be passed in Chr() form, as character literal, or
* as expression evaluating to Chr() value.
* $RETURNS$
* Returns resulting byte, in Chr() form. If parameters are faulty,
* returns NIL.
* $DESCRIPTION$
* Can be used for bit-wise byte manipulation. In effect, this is a
* bit-by-bit NEG (two's complement) operation. Equivalent to NEG
* assembler instruction.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code performs a bit-wise NEG on byte represented by Chr( 32 ):
*
* cNewByte := FT_BYTENOT( Chr( 32 ) )
* ? Asc( cNewByte ) // result: 224
* $SEEALSO$
* FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTEAND()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYTENEG()
$CATEGORY$
String
$ONELINER$
Perform bit-wise negation on an ASCII character
$SYNTAX$
FT_BYTENEG( <cByte> ) -> cNewByte
$ARGUMENTS$
<cByte> is a character from Chr(0) to Chr(255).
May be passed in Chr() form, as character literal, or
as expression evaluating to Chr() value.
$RETURNS$
Returns resulting byte, in Chr() form. If parameters are faulty,
returns NIL.
$DESCRIPTION$
Can be used for bit-wise byte manipulation. In effect, this is a
bit-by-bit NEG (two's complement) operation. Equivalent to NEG
assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code performs a bit-wise NEG on byte represented by Chr( 32 ):
cNewByte := FT_BYTENOT( Chr( 32 ) )
? Asc( cNewByte ) // result: 224
$SEEALSO$
FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTEAND()
$END$
*/

View File

@@ -2,36 +2,36 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYTENOT()
* $CATEGORY$
* String
* $ONELINER$
* Perform bit-wise NOT on an ASCII character (byte)
* $SYNTAX$
* FT_BYTENOT( <cByte> ) -> cNewByte
* $ARGUMENTS$
* <cByte> is a character from Chr(0) to Chr(255).
* May be passed in Chr() form, as character literal, or
* as expression evaluating to Chr() value.
* $RETURNS$
* Returns resulting byte, in Chr() form. If parameters are faulty,
* returns NIL.
* $DESCRIPTION$
* Can be used for bitwise byte manipulation. In effect, this is a
* bit-by-bit NOT (one's complement) operation. Equivalent to the
* NOT assembler instruction.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code performs a bitwise NOT on byte represented by Chr( 32 ):
*
* cNewByte := FT_BYTENOT( Chr( 32 ) )
* ? Asc( cNewByte ) // result: 223
* $SEEALSO$
* FT_BYTEOR() FT_BYTEXOR() FT_BYTENEG() FT_BYTEAND()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYTENOT()
$CATEGORY$
String
$ONELINER$
Perform bit-wise NOT on an ASCII character (byte)
$SYNTAX$
FT_BYTENOT( <cByte> ) -> cNewByte
$ARGUMENTS$
<cByte> is a character from Chr(0) to Chr(255).
May be passed in Chr() form, as character literal, or
as expression evaluating to Chr() value.
$RETURNS$
Returns resulting byte, in Chr() form. If parameters are faulty,
returns NIL.
$DESCRIPTION$
Can be used for bitwise byte manipulation. In effect, this is a
bit-by-bit NOT (one's complement) operation. Equivalent to the
NOT assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code performs a bitwise NOT on byte represented by Chr( 32 ):
cNewByte := FT_BYTENOT( Chr( 32 ) )
? Asc( cNewByte ) // result: 223
$SEEALSO$
FT_BYTEOR() FT_BYTEXOR() FT_BYTENEG() FT_BYTEAND()
$END$
*/

View File

@@ -2,37 +2,37 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYTEOR()
* $CATEGORY$
* String
* $ONELINER$
* Perform bit-wise OR on two ASCII characters (bytes)
* $SYNTAX$
* FT_BYTEOR( <cByte1>, <cByte2> ) -> cNewByte
* $ARGUMENTS$
* <cByte1> and <cByte2> are characters from Chr(0) TO Chr(255).
* May be passed in Chr() form, as character literals, or as
* expressions evaluating to Chr() values.
* $RETURNS$
* Returns resulting byte, in Chr() form. If parameters are faulty,
* returns NIL.
* $DESCRIPTION$
* Can be used for bit-wise byte manipulation. In effect, this is a
* bit-by-bit OR operation. Equivalent to OR assembler instruction.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code performs a bit-wise OR on two bytes represented
* by Chr( 20 ) and Chr( 10 ):
*
* cNewByte := FT_BYTEOR( Chr( 20 ), Chr( 10 ) )
* ? Asc( cNewByte ) // result: 30
* ? cNewByte // result: non-printable character
* $SEEALSO$
* FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYTEOR()
$CATEGORY$
String
$ONELINER$
Perform bit-wise OR on two ASCII characters (bytes)
$SYNTAX$
FT_BYTEOR( <cByte1>, <cByte2> ) -> cNewByte
$ARGUMENTS$
<cByte1> and <cByte2> are characters from Chr(0) TO Chr(255).
May be passed in Chr() form, as character literals, or as
expressions evaluating to Chr() values.
$RETURNS$
Returns resulting byte, in Chr() form. If parameters are faulty,
returns NIL.
$DESCRIPTION$
Can be used for bit-wise byte manipulation. In effect, this is a
bit-by-bit OR operation. Equivalent to OR assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code performs a bit-wise OR on two bytes represented
by Chr( 20 ) and Chr( 10 ):
cNewByte := FT_BYTEOR( Chr( 20 ), Chr( 10 ) )
? Asc( cNewByte ) // result: 30
? cNewByte // result: non-printable character
$SEEALSO$
FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND()
$END$
*/

View File

@@ -2,37 +2,37 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_BYTEXOR()
* $CATEGORY$
* String
* $ONELINER$
* Perform bit-wise XOR on two ASCII characters (bytes)
* $SYNTAX$
* FT_BYTEXOR( <cByte1>, <cByte2> ) -> cNewByte
* $ARGUMENTS$
* <cByte1> and <cByte2> are characters from Chr(0) to Chr(255).
* May be passed in Chr() form, as character literals, or
* as expressions evaluating to Chr() values.
* $RETURNS$
* Returns resulting byte, in Chr() form. If parameters are faulty,
* returns NIL.
* $DESCRIPTION$
* Can be used for bit-wise byte manipulation. In effect, this is a
* bit-by-bit XOR operation. Equivalent to XOR assembler instruction.
*
* This function is presented to illustrate that bit-wise operations
* are possible with Clipper code. For greater speed, write .c or
* .asm versions and use the Clipper Extend system.
* $EXAMPLES$
* This code performs a bit-wise XOR on two bytes represented
* by Chr( 32 ) and Chr( 55 ):
*
* cNewByte := FT_BYTEXOR( Chr( 32 ), Chr( 55 ) )
* ? Asc( cNewByte ) // result: 23
* ? cNewByte // result: non-printable character
* $SEEALSO$
* FT_BYTEOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND()
* $END$
/* $DOC$
$FUNCNAME$
FT_BYTEXOR()
$CATEGORY$
String
$ONELINER$
Perform bit-wise XOR on two ASCII characters (bytes)
$SYNTAX$
FT_BYTEXOR( <cByte1>, <cByte2> ) -> cNewByte
$ARGUMENTS$
<cByte1> and <cByte2> are characters from Chr(0) to Chr(255).
May be passed in Chr() form, as character literals, or
as expressions evaluating to Chr() values.
$RETURNS$
Returns resulting byte, in Chr() form. If parameters are faulty,
returns NIL.
$DESCRIPTION$
Can be used for bit-wise byte manipulation. In effect, this is a
bit-by-bit XOR operation. Equivalent to XOR assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
$EXAMPLES$
This code performs a bit-wise XOR on two bytes represented
by Chr( 32 ) and Chr( 55 ):
cNewByte := FT_BYTEXOR( Chr( 32 ), Chr( 55 ) )
? Asc( cNewByte ) // result: 23
? cNewByte // result: non-printable character
$SEEALSO$
FT_BYTEOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND()
$END$
*/

View File

@@ -2,73 +2,73 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_CALENDAR()
* $CATEGORY$
* Date/Time
* $ONELINER$
* Display date/time calendar, find a date, return calendar data.
* $SYNTAX$
* FT_CALENDAR ( [ <nRow> ], [ <nCol> ], [ <cColor> ], [ <lShadow> ] ,
* [ <lShowHelp> ] ) -> aRetVal
* $ARGUMENTS$
* <nRow> is an optional screen row for calendar display,
* default row 1.
*
* <nCol> is an optional screen col for calendar display,
* default col 63.
*
* <cColor> is an optional color string for displayed messages,
* default is bright white text over green background.
*
* <lShadow> is an optional logical variable. If true (.T.),
* it uses FT_SHADOW() to add a transparent shadow
* to the display, default (.F.).
*
* <lShowHelp> is an optional logical variable. If true, uses
* FT_XBOX to display a four line help message
* if the F1 key is pressed, default (.F.).
*
* $RETURNS$
* aRetVal is an 8 element array containing date, month, day, year,
* month (in character format), day of the week, julian day
* and current time.
*
* $DESCRIPTION$
* FT_CALENDAR() simply displays today's date, time and julian
* day in a two line display with an optional box shadow. Cursor keys may
* be used to page through the calendar by day, week, month or year
* increments. Returns an 8 element array of calendar data:
*
* Element Value
* [1] Date in current date format.
* [2] Numeric month number.
* [3] Numeric day number.
* [4] Numeric year number.
* [5] Month in character format.
* [6] Day of the week in character format.
* [7] Numeric Julian day.
* [8] Current time in time format.
*
* WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX
* from the Nanforum Toolkit!
*
* $EXAMPLES$
* LOCAL aRetVal[ 8 ]
* CLS
* aRetVal := FT_CALENDAR( 10, 40, "W+/RB", .T., .T. )
* ? aRetVal[ 1 ] // Result: 04/20/91
* ? aRetVal[ 2 ] // Result: 4
* ? aRetVal[ 3 ] // Result: 20
* ? aRetVal[ 4 ] // Result: 1991
* ? aRetVal[ 5 ] // Result: April
* ? aRetVal[ 6 ] // Result: Saturday
* ? aRetVal[ 7 ] // Result: 110
* ? aRetVal[ 8 ] // Result: 12:45:20
*
* $SEEALSO$
* FT_DAYOFYR()
*
* $END$
/* $DOC$
$FUNCNAME$
FT_CALENDAR()
$CATEGORY$
Date/Time
$ONELINER$
Display date/time calendar, find a date, return calendar data.
$SYNTAX$
FT_CALENDAR ( [ <nRow> ], [ <nCol> ], [ <cColor> ], [ <lShadow> ] ,
[ <lShowHelp> ] ) -> aRetVal
$ARGUMENTS$
<nRow> is an optional screen row for calendar display,
default row 1.
<nCol> is an optional screen col for calendar display,
default col 63.
<cColor> is an optional color string for displayed messages,
default is bright white text over green background.
<lShadow> is an optional logical variable. If true (.T.),
it uses FT_SHADOW() to add a transparent shadow
to the display, default (.F.).
<lShowHelp> is an optional logical variable. If true, uses
FT_XBOX to display a four line help message
if the F1 key is pressed, default (.F.).
$RETURNS$
aRetVal is an 8 element array containing date, month, day, year,
month (in character format), day of the week, julian day
and current time.
$DESCRIPTION$
FT_CALENDAR() simply displays today's date, time and julian
day in a two line display with an optional box shadow. Cursor keys may
be used to page through the calendar by day, week, month or year
increments. Returns an 8 element array of calendar data:
Element Value
[1] Date in current date format.
[2] Numeric month number.
[3] Numeric day number.
[4] Numeric year number.
[5] Month in character format.
[6] Day of the week in character format.
[7] Numeric Julian day.
[8] Current time in time format.
WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX
from the Nanforum Toolkit!
$EXAMPLES$
LOCAL aRetVal[ 8 ]
CLS
aRetVal := FT_CALENDAR( 10, 40, "W+/RB", .T., .T. )
? aRetVal[ 1 ] // Result: 04/20/91
? aRetVal[ 2 ] // Result: 4
? aRetVal[ 3 ] // Result: 20
? aRetVal[ 4 ] // Result: 1991
? aRetVal[ 5 ] // Result: April
? aRetVal[ 6 ] // Result: Saturday
? aRetVal[ 7 ] // Result: 110
? aRetVal[ 8 ] // Result: 12:45:20
$SEEALSO$
FT_DAYOFYR()
$END$
*/

View File

@@ -2,31 +2,31 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_CAPLOCK()
* $CATEGORY$
* Keyboard/Mouse
* $ONELINER$
* Determine and optionally change the status of CapLock key
* $SYNTAX$
* FT_CAPLOCK([ <lNewSetting> ]) -> lCurrentSetting
* $ARGUMENTS$
* <lNewSetting> is optional and if supplied is the new setting
* for the CapLock key. Specify .T. to turn CapLock on, or .F. to
* turn it off.
* $RETURNS$
* .T. if CapLock is set, .F. if it isn't set. The value returned
* represents the setting in effect prior to any changes that might
* by made by <lNewSetting>.
* $DESCRIPTION$
* This function is useful if you need to know or set the status of the
* CapLock key for some reason.
* $EXAMPLES$
* IF FT_CAPLOCK()
* ? "CapLock is active"
* ENDIF
* $SEEALSO$
* FT_ALT() FT_CTRL() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT()
* $END$
/* $DOC$
$FUNCNAME$
FT_CAPLOCK()
$CATEGORY$
Keyboard/Mouse
$ONELINER$
Determine and optionally change the status of CapLock key
$SYNTAX$
FT_CAPLOCK([ <lNewSetting> ]) -> lCurrentSetting
$ARGUMENTS$
<lNewSetting> is optional and if supplied is the new setting
for the CapLock key. Specify .T. to turn CapLock on, or .F. to
turn it off.
$RETURNS$
.T. if CapLock is set, .F. if it isn't set. The value returned
represents the setting in effect prior to any changes that might
by made by <lNewSetting>.
$DESCRIPTION$
This function is useful if you need to know or set the status of the
CapLock key for some reason.
$EXAMPLES$
IF FT_CAPLOCK()
? "CapLock is active"
ENDIF
$SEEALSO$
FT_ALT() FT_CTRL() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT()
$END$
*/

View File

@@ -2,32 +2,32 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_CHDIR()
* $CATEGORY$
* DOS/BIOS
* $ONELINER$
* Change the current directory
* $SYNTAX$
* FT_CHDIR( <cDirName> ) -> nResult
* $ARGUMENTS$
* <cDirName> is the name of the desired directory.
* $RETURNS$
* 0 if successful
* 3 if path not found
* 99 if invalid parameters passed
* $DESCRIPTION$
* Use this function if you prefer to change the active directory
* instead of relying on the SET PATH command.
*
* The source code is written to adhere to Turbo Assembler's IDEAL mode.
* To use another assembler, you will need to rearrange the PROC and
* SEGMENT directives, and also the ENDP and ENDS directives (a very
* minor task).
* $EXAMPLES$
* FT_CHDIR( "C:\harbour" )
* FT_CHDIR( hb_ps() )
* FT_CHDIR( ".." + hb_ps() + "hbnf" )
* $END$
/* $DOC$
$FUNCNAME$
FT_CHDIR()
$CATEGORY$
DOS/BIOS
$ONELINER$
Change the current directory
$SYNTAX$
FT_CHDIR( <cDirName> ) -> nResult
$ARGUMENTS$
<cDirName> is the name of the desired directory.
$RETURNS$
0 if successful
3 if path not found
99 if invalid parameters passed
$DESCRIPTION$
Use this function if you prefer to change the active directory
instead of relying on the SET PATH command.
The source code is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, you will need to rearrange the PROC and
SEGMENT directives, and also the ENDP and ENDS directives (a very
minor task).
$EXAMPLES$
FT_CHDIR( "C:\harbour" )
FT_CHDIR( hb_ps() )
FT_CHDIR( ".." + hb_ps() + "hbnf" )
$END$
*/

View File

@@ -2,151 +2,151 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_INT86()
* $CATEGORY$
* DOS/BIOS
* $ONELINER$
* Execute a software interrupt
* $SYNTAX$
* FT_INT86( <nInterruptNumber>, <aRegisterValues> ) -> lResult
* $ARGUMENTS$
* <nInterruptNumber> is the interrupt to execute.
*
* <aRegisterValues> is an array that contains values to be loaded
* into the various CPU registers. The correspondence between
* registers and array elements is as follows:
*
* aElement[1] == AX register
* aElement[2] == BX register
* aElement[3] == CX register
* aElement[4] == DX register
* aElement[5] == SI register
* aElement[6] == DI register
* aElement[7] == BP register
* aElement[8] == DS register
* aElement[9] == ES register
* aElement[10] == Flags register
* $RETURNS$
* .T. if all parameters valid and the function was able
* to execute the desired interrupt.
* .F. if invalid parameters passed. If you call this function in
* protected mode, .F. may also be returned if an allocation
* of low DOS memory fails.
*
* n addition, the array elements will contain whatever values were in
* he CPU registers immediately after the interrupt was executed. If
* ither of the string parameters were altered by the interrupt, these
* hanges will be reflected as well.
* $DESCRIPTION$
* It is occasionally useful to be able to call interrupts directly from
* Clipper, without having to write a separate routine in C or ASM. This
* function allows you that capability.
*
* Given Clipper's high-level orientation, this function is necessarily
* somewhat messy to use. First, declare an array of ten elements to
* hold the eight values for the CPU registers and two string parameters.
* Then initialize the array elements with the values that you want the
* CPU registers to contain when the interrupt is executed. You need not
* initialize all the elements. For example, if the interrupt requires
* you to specify values for AX, DX, and DS, you would only need to
* initialize elements 1, 4, and 8.
*
* Once you have done the required register setup, call FT_INT86(),
* passing the interrupt number and the register array as parameters.
* The function will load the CPU with your specified values, execute the
* interrupt, and then store the contents of the CPU registers back into
* your array. This will allow you to evaluate the results of the
* interrupt.
*
* Some interrupt services require you to pass the address of a string in
* a pair of registers. This function is capable of handling these sorts
* of situations, but it will take a little work on your part. If you need
* to pass a string that uses the DS register, store the string in element
* 8; if you need to pass a string that uses the ES register, store the
* string in element 9. FT_INT86() will detect that you've supplied a
* string instead of a numeric value and will behave accordingly.
*
* That takes care of obtaining the segment portion of the pointer. To
* specify which register is to contain the offset, use the values REG_DS
* and REG_ES which are defined in the FTINT86.CH file. When one of these
* values is found in an array element, it alerts FT_Int86() to use the
* offset portion of a pointer instead of a numeric value. REG_DS tells
* FT_Int86() to use the offset of the string in element 8, while REG_ES
* tells FT_Int86() to use the offset of the string in element 9.
*
* All the CPU registers are sixteen bits in size. Some, however, are
* also split into two 8-bit registers. This function is only capable of
* receiving and returning registers that are 16 bits in size. To split
* a 16-bit register into two 8-bit values, you can use the
* pseudo-functions HighByte() and LowByte(), contained in the .CH file.
*
* To alter an 8-bit number so it will appear in the high-order byte of a
* register when passed to the FT_INT86() function, use the MakeHI()
* pseudo-function contained in the .CH file.
*
* When run in real mode, this function is a shell for __ftint86(),
* which is written in assembler and does the actual work of executing
* the interrupt. __ftint86() is callable from C, so feel free to
* incorporate it into any C routines for which it might be useful. The
* source for __ftint86() can be found in the file AINT86.ASM.
*
* When run in protected mode, this function is a shell for cpmiInt86(),
* which is written in assembler and makes a DPMI call to drop into
* real mode and execute the interrupt. cpmiInt86() is also callable
* from C, so feel free to incorporate it into any C routines for which
* it might be useful. cpmiInt86() is part of the CPMI API. See the
* CPMI documentation for more information.
* $EXAMPLES$
* * This example shows how to call the DOS "create file" service. Take
* * special note of how to set up string parameters.
*
* #include "ftint86.ch"
*
* LOCAL aRegs[ 10 ] // Declare the register array
* aRegs[ AX ] := makehi( 60 ) // DOS service, create file
* aRegs[ CX ] := 0 // Specify file attribute
*
* * Pay attention here, this is crucial. Note how to set up the string
* * so it appears in DS:DX.
*
* aRegs[ DS ] := "C:\misc\myfile.xxx"
* aRegs[ DX ] := REG_DS
* FT_INT86( 33, aRegs ) // Make the call to the DOS interrupt
*
*
* * This example shows how to call the DOS "get current directory"
* * service. This one also uses a string parameter, but note that it
* * uses a different offset register.
*
* #include "ftint86.ch"
*
* LOCAL aRegs[ 10 ]
* aRegs[ AX ] := makehi( 71 )
* aRegs[ DX ] := 0 // Choose default drive
*
* * This service requires a 64-byte buffer whose address is in DS:SI. DOS
* * will fill the buffer with the current directory.
*
* aRegs[ DS ] := Space( 64 )
* aRegs[ SI ] := REG_DS
* FT_INT86( 33, aRegs )
*
* ? aRegs[ DS ] // Display the directory name
*
*
*
* * For the sake of completeness, here's an example that doesn't use a
* * string. This one changes the video mode.
*
* #include "ftint86.ch"
*
* LOCAL aRegs[ 10 ]
*
* aRegs[ AX ] := 16 // Choose hi-res graphics
* FT_INT86( 16, aRegs )
* $INCLUDE$
* ftint86.ch
* $END$
/* $DOC$
$FUNCNAME$
FT_INT86()
$CATEGORY$
DOS/BIOS
$ONELINER$
Execute a software interrupt
$SYNTAX$
FT_INT86( <nInterruptNumber>, <aRegisterValues> ) -> lResult
$ARGUMENTS$
<nInterruptNumber> is the interrupt to execute.
<aRegisterValues> is an array that contains values to be loaded
into the various CPU registers. The correspondence between
registers and array elements is as follows:
aElement[1] == AX register
aElement[2] == BX register
aElement[3] == CX register
aElement[4] == DX register
aElement[5] == SI register
aElement[6] == DI register
aElement[7] == BP register
aElement[8] == DS register
aElement[9] == ES register
aElement[10] == Flags register
$RETURNS$
.T. if all parameters valid and the function was able
to execute the desired interrupt.
.F. if invalid parameters passed. If you call this function in
protected mode, .F. may also be returned if an allocation
of low DOS memory fails.
n addition, the array elements will contain whatever values were in
he CPU registers immediately after the interrupt was executed. If
ither of the string parameters were altered by the interrupt, these
hanges will be reflected as well.
$DESCRIPTION$
It is occasionally useful to be able to call interrupts directly from
Clipper, without having to write a separate routine in C or ASM. This
function allows you that capability.
Given Clipper's high-level orientation, this function is necessarily
somewhat messy to use. First, declare an array of ten elements to
hold the eight values for the CPU registers and two string parameters.
Then initialize the array elements with the values that you want the
CPU registers to contain when the interrupt is executed. You need not
initialize all the elements. For example, if the interrupt requires
you to specify values for AX, DX, and DS, you would only need to
initialize elements 1, 4, and 8.
Once you have done the required register setup, call FT_INT86(),
passing the interrupt number and the register array as parameters.
The function will load the CPU with your specified values, execute the
interrupt, and then store the contents of the CPU registers back into
your array. This will allow you to evaluate the results of the
interrupt.
Some interrupt services require you to pass the address of a string in
a pair of registers. This function is capable of handling these sorts
of situations, but it will take a little work on your part. If you need
to pass a string that uses the DS register, store the string in element
8; if you need to pass a string that uses the ES register, store the
string in element 9. FT_INT86() will detect that you've supplied a
string instead of a numeric value and will behave accordingly.
That takes care of obtaining the segment portion of the pointer. To
specify which register is to contain the offset, use the values REG_DS
and REG_ES which are defined in the FTINT86.CH file. When one of these
values is found in an array element, it alerts FT_Int86() to use the
offset portion of a pointer instead of a numeric value. REG_DS tells
FT_Int86() to use the offset of the string in element 8, while REG_ES
tells FT_Int86() to use the offset of the string in element 9.
All the CPU registers are sixteen bits in size. Some, however, are
also split into two 8-bit registers. This function is only capable of
receiving and returning registers that are 16 bits in size. To split
a 16-bit register into two 8-bit values, you can use the
pseudo-functions HighByte() and LowByte(), contained in the .CH file.
To alter an 8-bit number so it will appear in the high-order byte of a
register when passed to the FT_INT86() function, use the MakeHI()
pseudo-function contained in the .CH file.
When run in real mode, this function is a shell for __ftint86(),
which is written in assembler and does the actual work of executing
the interrupt. __ftint86() is callable from C, so feel free to
incorporate it into any C routines for which it might be useful. The
source for __ftint86() can be found in the file AINT86.ASM.
When run in protected mode, this function is a shell for cpmiInt86(),
which is written in assembler and makes a DPMI call to drop into
real mode and execute the interrupt. cpmiInt86() is also callable
from C, so feel free to incorporate it into any C routines for which
it might be useful. cpmiInt86() is part of the CPMI API. See the
CPMI documentation for more information.
$EXAMPLES$
* This example shows how to call the DOS "create file" service. Take
* special note of how to set up string parameters.
#include "ftint86.ch"
LOCAL aRegs[ 10 ] // Declare the register array
aRegs[ AX ] := makehi( 60 ) // DOS service, create file
aRegs[ CX ] := 0 // Specify file attribute
* Pay attention here, this is crucial. Note how to set up the string
* so it appears in DS:DX.
aRegs[ DS ] := "C:\misc\myfile.xxx"
aRegs[ DX ] := REG_DS
FT_INT86( 33, aRegs ) // Make the call to the DOS interrupt
* This example shows how to call the DOS "get current directory"
* service. This one also uses a string parameter, but note that it
* uses a different offset register.
#include "ftint86.ch"
LOCAL aRegs[ 10 ]
aRegs[ AX ] := makehi( 71 )
aRegs[ DX ] := 0 // Choose default drive
* This service requires a 64-byte buffer whose address is in DS:SI. DOS
* will fill the buffer with the current directory.
aRegs[ DS ] := Space( 64 )
aRegs[ SI ] := REG_DS
FT_INT86( 33, aRegs )
? aRegs[ DS ] // Display the directory name
* For the sake of completeness, here's an example that doesn't use a
* string. This one changes the video mode.
#include "ftint86.ch"
LOCAL aRegs[ 10 ]
aRegs[ AX ] := 16 // Choose hi-res graphics
FT_INT86( 16, aRegs )
$INCLUDE$
ftint86.ch
$END$
*/

View File

@@ -2,101 +2,101 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_ClrSel()
* $CATEGORY$
* Menus/Prompts
* $ONELINER$
* User Selectable Colour Routine
* $SYNTAX$
* FT_ClrSel( <aClrData>, [ <lClrMode> ], [ <cTestChr> ] -> aClrData
* $ARGUMENTS$
* <aClrData> is an array of subarrays, with each subarray containing
* information about the colour settings.
*
* The subarray has the following structure:
*
* [1] cName is the name of this colour setting i.e. "Pick List"
* Maximum length is 20 bytes
*
* [2] cClrStr is the current colour string
* Default is "W/N,N/W,N/N,N/N,N/W"
*
* If Setting type is "M" (Menu) the colours are...
* 1. Prompt Colour
* 2. Message Colour
* 3. HotKey Colour
* 4. LightBar Colour
* 5. LightBar HotKey Colour
*
* Note: While there are many ways to code the individual
* colour combinations, they should be in the same
* format that gets returned from SETCOLOR(), so
* the defaults can be found in the colour palette.
*
* foreground [+] / background [*]
* i.e. "GR+/BG*, N/W*, N+/N, , W/N"
*
* [3] cType is the type of colour setting
* Default is "W" (Window)
*
* T = Title Only 1 colour element
* D = Desktop Background colour and character
* M = Menu For FT_Menuto() style menus
* W = Window Windows with radio buttons
* G = Get For use with @ SAY...
* B = Browse For tBrowse() and *dbEdit()
* A = aChoice Pick-lists etc...
*
* W/G/B/A are functionally the same but will provide
* a more appropriate test display.
*
* [4] cFillChar is the character (for desktop background only)
* Default is Chr(177) "▒▒▒▒▒▒▒▒▒▒▒▒▒▒"
*
*
* <lClrMode> .T. use colour palette
* .F. use monochrome palette
*
* Default is the ISCOLOR() setting
*
* <cTestChr> 2 Byte character string for colour test display
*
* Default is the Chr(254)+Chr(254) ""
*
* $RETURNS$
* An array identical to the one passed, with new selected colours
* $DESCRIPTION$
* This function allows users to select their own colour combinations
* for all the different types of screen I/O in a typical application.
* This facilitates an easy implementation of Ted Means' replacement
* of the @..PROMPT/MENU TO found in the NanForum Toolkit. If you are
* not using FT_MENUTO(), you can specify "A" for setting type and have
* a normal colour string returned.
* $EXAMPLES$
* LOCAL aClrs := {}
* LOCAL lColour := IsColor()
* LOCAL cChr := Chr( 254 ) + Chr( 254 )
*
* SET SCOREBOARD Off
* SETBLINK( .F. ) // Allow bright backgrounds
*
* *.... a typical application might have the following different settings
* * normally these would be stored in a .dbf/.dbv
* aClrs := {;
* { "Desktop", "N/BG", "D", "▒" }, ;
* { "Title", "N/W", "T" }, ;
* { "Top Menu", "N/BG,N/W,W+/BG,W+/N,GR+/N", "M" }, ;
* { "Sub Menu", "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R","M" }, ;
* { "Standard Gets", "W/B, W+/N,,, W/N", "G" }, ;
* { "Nested Gets", "N/BG, W+/N,,, W/N", "G" }, ;
* { "Help", "N/G, W+/N,,, W/N", "W" }, ;
* { "Error Messages", "W+/R*,N/GR*,,,N/R*", "W" }, ;
* { "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ;
* { "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } ;
* }
*
* aClrs := FT_ClrSel( aClrs, lColour, cChr )
* $END$
/* $DOC$
$FUNCNAME$
FT_ClrSel()
$CATEGORY$
Menus/Prompts
$ONELINER$
User Selectable Colour Routine
$SYNTAX$
FT_ClrSel( <aClrData>, [ <lClrMode> ], [ <cTestChr> ] -> aClrData
$ARGUMENTS$
<aClrData> is an array of subarrays, with each subarray containing
information about the colour settings.
The subarray has the following structure:
[1] cName is the name of this colour setting i.e. "Pick List"
Maximum length is 20 bytes
[2] cClrStr is the current colour string
Default is "W/N,N/W,N/N,N/N,N/W"
If Setting type is "M" (Menu) the colours are...
1. Prompt Colour
2. Message Colour
3. HotKey Colour
4. LightBar Colour
5. LightBar HotKey Colour
Note: While there are many ways to code the individual
colour combinations, they should be in the same
format that gets returned from SETCOLOR(), so
the defaults can be found in the colour palette.
foreground [+] / background [*]
i.e. "GR+/BG*, N/W*, N+/N, , W/N"
[3] cType is the type of colour setting
Default is "W" (Window)
T = Title Only 1 colour element
D = Desktop Background colour and character
M = Menu For FT_Menuto() style menus
W = Window Windows with radio buttons
G = Get For use with @ SAY...
B = Browse For tBrowse() and *dbEdit()
A = aChoice Pick-lists etc...
W/G/B/A are functionally the same but will provide
a more appropriate test display.
[4] cFillChar is the character (for desktop background only)
Default is Chr(177) "▒▒▒▒▒▒▒▒▒▒▒▒▒▒"
<lClrMode> .T. use colour palette
.F. use monochrome palette
Default is the ISCOLOR() setting
<cTestChr> 2 Byte character string for colour test display
Default is the Chr(254)+Chr(254) ""
$RETURNS$
An array identical to the one passed, with new selected colours
$DESCRIPTION$
This function allows users to select their own colour combinations
for all the different types of screen I/O in a typical application.
This facilitates an easy implementation of Ted Means' replacement
of the @..PROMPT/MENU TO found in the NanForum Toolkit. If you are
not using FT_MENUTO(), you can specify "A" for setting type and have
a normal colour string returned.
$EXAMPLES$
LOCAL aClrs := {}
LOCAL lColour := IsColor()
LOCAL cChr := Chr( 254 ) + Chr( 254 )
SET SCOREBOARD Off
SETBLINK( .F. ) // Allow bright backgrounds
*.... a typical application might have the following different settings
* normally these would be stored in a .dbf/.dbv
aClrs := {;
{ "Desktop", "N/BG", "D", "▒" }, ;
{ "Title", "N/W", "T" }, ;
{ "Top Menu", "N/BG,N/W,W+/BG,W+/N,GR+/N", "M" }, ;
{ "Sub Menu", "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R","M" }, ;
{ "Standard Gets", "W/B, W+/N,,, W/N", "G" }, ;
{ "Nested Gets", "N/BG, W+/N,,, W/N", "G" }, ;
{ "Help", "N/G, W+/N,,, W/N", "W" }, ;
{ "Error Messages", "W+/R*,N/GR*,,,N/R*", "W" }, ;
{ "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ;
{ "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } ;
}
aClrs := FT_ClrSel( aClrs, lColour, cChr )
$END$
*/

View File

@@ -2,32 +2,32 @@
* $Id$
*/
/* $DOC$
* $FUNCNAME$
* FT_SETCENTURY()
* $CATEGORY$
* Environment
* $ONELINER$
* Check/Set the CENTURY Setting
* $SYNTAX$
* FT_SETCENTURY( [ <lNewSetState> ] ) -> <lOldState>
* $ARGUMENTS$
* lNewSetState - Boolean to Set CENTURY
* .F. - Toggle CENTURY off
* .T. - Toggle CENTURY on
* If not specified, leave CENTURY as is
* $RETURNS$
* The state of the CENTURY setting upon entry to the routine
* $DESCRIPTION$
* This function returns the state (ON/OFF, TRUE/FALSE) of the CENTURY
* and optionally sets it ON or OFF.
* $EXAMPLES$
* lOldState := FT_SETCENTURY() // Get current CENTURY Setting
*
* lOldState := FT_SETCENTURY( .T. ) // Get the current CENTURY Setting
* // and turn it on (set it to TRUE)
*
* lOldState := FT_SETCENTURY( .F. ) // Get the current CENTURY Setting
* // and turn it off (set it to FALSE)
* $END$
/* $DOC$
$FUNCNAME$
FT_SETCENTURY()
$CATEGORY$
Environment
$ONELINER$
Check/Set the CENTURY Setting
$SYNTAX$
FT_SETCENTURY( [ <lNewSetState> ] ) -> <lOldState>
$ARGUMENTS$
lNewSetState - Boolean to Set CENTURY
.F. - Toggle CENTURY off
.T. - Toggle CENTURY on
If not specified, leave CENTURY as is
$RETURNS$
The state of the CENTURY setting upon entry to the routine
$DESCRIPTION$
This function returns the state (ON/OFF, TRUE/FALSE) of the CENTURY
and optionally sets it ON or OFF.
$EXAMPLES$
lOldState := FT_SETCENTURY() // Get current CENTURY Setting
lOldState := FT_SETCENTURY( .T. ) // Get the current CENTURY Setting
// and turn it on (set it to TRUE)
lOldState := FT_SETCENTURY( .F. ) // Get the current CENTURY Setting
// and turn it off (set it to FALSE)
$END$
*/

Some files were not shown because too many files have changed in this diff Show More