<sResString> ADDSLASHES(<sString>) cTrimString ALLTRIM(<cString>) nCode ASC(<cExp>) nPosition AT(<cSearch>, <cTarget>) TRUE || FALSE BETWEEN(<TargetData>, <FirstData>, <SecondData>) cResult bUnZip2(<cData>) cResult bZip2(<cData> [,<nLevel>]) cChar CHR(<nCode>) <nCount> CSCOUNT(<ÓChar>, <sString>) <nValue> DSTRTON(<sString>) lEmpty EMPTY(<exp>) <nValue> FSTRTON(<sString>) nPos FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) cByte FT_BITCLR( <cByte>, <nBitPos> ) cByte FT_BITSET( <cByte>, <nBitPos> ) cByte FT_BYTEAND( <cByte1>, <cByte2> ) cNewByte FT_BYTENEG( <cByte> ) cNewByte FT_BYTENOT( <cByte> ) cNewByte FT_BYTEOR( <cByte1>, <cByte2> ) cNewByte FT_BYTEXOR( <cByte1>, <cByte2> ) <nStringPosition> FT_FINDITH( <cCheckFor>, <cCheckIn>, <nWhichOccurrence> ; [, <lIgnoreCase> ] ) lResult FT_ISBIT( <cByte>, <nBitPos> ) lResult FT_ISBITON( <nNumber>, <nBit> ) cMetaPhone FT_METAPH( <cName> [, <nSize> ] ) <nOccurrences> FT_NOOCCUR( <cCheckFor>, <cCheckIn> ; [, <lIgnoreCase> ] ) <cPrinterFormat> FT_PCHR( <cString> ) TRUE || FALSE GLOB(<sString>, <sReg>, [<lIgnoreCase>]) cResult gUnZip(<cData>) cResult gZip(<cData> [,<nLevel>]) cConvertedString HARDCR(<cString>) <sStr> HASHNAME(<nHashCode>) <nHashCode> HASHSTR(<sStr>) lBoolean ISALPHA(<cString>) lBoolean ISDIGIT(<cString>) lBoolean ISLOWER(<cString>) lBoolean ISUPPER(<cString>) cSubString LEFT(<cString>, <nCount>) nCount LEN(<cString> | <aTarget>) TRUE || FALSE LIKE(<sMask>, <sString>) cLowerString LOWER(<cString>) cTrimString LTRIM(<cString>) cTextBuffer MEMOEDIT([<cString>], [<nTop>], [<nLeft>], [<nBottom>], [<nRight>], [<lEditMode>], [<cUserFunction>], [<nLineLength>], [<nTabSize>], [<nTextBufferRow>], [<nTextBufferColumn>], [<nWindowRow>], [<nWindowColumn>]) cLine MEMOLINE(<cString>,[<nLineLength>],[<nLineNumber>], [<nTabSize>],[<lWrap>]) cString MEMOREAD(<cFile>) cNewString MEMOTRAN(<cString>,[<cReplaceHardCR>],[<cReplaceSoftCR>]) lSuccess MEMOWRIT(<cFile>, <cString>) nLines MLCOUNT(<cString>, [<nLineLength>],[<nTabSize>], [<lWrap>]) nPosition MLCTOPOS(<cText>, <nWidth>, <nLine>, <nCol>, [<nTabSize>], [<lWrap>]) nPosition MLPOS(<cString>, <nLineLength>, <nLine>, [<nTabSize>], [<lWrap>]) aLineColumn MPOSTOLC(<cText>, <nWidth>, <nPos>, [<nTabSize>], [<lWrap>]) cPaddedString PADL(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString PADC(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString PADR(<exp>, <nLength>, [<cFillChar>]) NIL QOUT([<exp list>]) --> NIL QQOUT([<exp list>]) nPosition RAT(<cSearch>, <cTarget>) cRepeatedString REPLICATE(<cString>, <nCount>) cSubString RIGHT(<cString>, <nCount>) cTrimString [R]TRIM(<cString>) TRUE || FALSE SEARCH(<sPattern>, <sString>, [@aReg], [<nFrom>], [<nRange>]) cSoundexString SOUNDEX(<cString>) cSpaces SPACE(<nCount>) cNumber STR(<nNumber>, [<nLength>], [<nDecimals>]) <vData> STR2VAR(<sUucodeStr>) cNewString STRTRAN(<cString>, <cSearch>,[<cReplace>], [<nStart>], [<nCount>]) cNewString STUFF(<cString>, <nStart>, <nDelete>, <cInsert>) cSubstring SUBSTR(<cString>, <nStart>, [<nCount>]) cFormatString TRANSFORM(<exp>, <cSayPicture>) cTrimString TRIM(<cString>) cType TYPE(<cExp>) cUpperString UPPER(<cString>) nNumber VAL(<cNumber>) cType VALTYPE(<exp>) <sUucodeStr> VAR2STR(<vData>) <nCode> WEIGHTASC(<sString>) <sTable> WEIGHTTABLE()
ADDSLASHES(<sString>) --> <sResString>
ADDSLASHES() returns a string <sResString> with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash (\) and NUL (the null byte).
ALLTRIM(<cString>) --> cTrimString
ALLTRIM() is a character function that removes both leading and trailing spaces from a string. It is related to LTRIM() and RTRIM() which remove leading and trailing spaces, respectively. The inverse of ALLTRIM(), LTRIM(), and RTRIM() are the PADC(), PADL(), and PADR() functions which center, left-justify, or right-justify character strings by padding them with fill characters.
ASC(<cExp>) --> nCode
ASC() is a character conversion function that returns the ASCII value of the leftmost character in a character string. ASC() is used primarily on expressions requiring numeric calculations on the ASCII value of a character. CHR() and ASC() are inverse functions.
AT(<cSearch>, <cTarget>) --> nPosition
AT() is a character function used to determine the position of the first occurrence of a character substring within another string. If you only need to know whether a substring exists within another string, use the $ operator. To find the last instance of a substring within a string, use RAT().
<cSearch> | is the character substring to be searched for. |
<cTarget> | is the character string to be searched. |
Returns : | AT() returns the position of the first instance of <cSearch> within <cTarget> as an integer numeric value. If <cSearch> is not found, AT() returns zero. |
See also : | RAT() STRTRAN() SUBSTR() |
BETWEEN(<TargetData>, <FirstData>, <SecondData>) --> TRUE || FALSE
BETWEEN() compares source value <TargetData> with <FirstData> and <SecondData>. If <TargetData> locate between <FirstData> and <SecondData>, BETWEEN() returns TRUE.
All values must be ones type (string, numeric, date, ...).
CHR(<nCode>) --> cChar
CHR() is a numeric conversion function that converts an ASCII code to a character. It is the inverse of ASC(). CHR() serves a number of common tasks including:
Sending control codes and graphics characters to the screen or printer
Ringing the bell
Converting INKEY() return values to characters
Stuffing the keyboard buffer
CSCOUNT(<ÓChar>, <sString>) --> <nCount>
CSCOUNT() returns the number of character <cChar> into source string <sString>.
DSTRTON(<sString>) --> <nValue>
DSTRTON() converts string <sString> to numeric values and returns it.
FSTRTON(<sString>) --> <nValue>
FSTRTON() converts string <sString> to numeric values and returns it.
FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) --> nPos
This function will find the nth occurrence of a substring within a string.
<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 |
See also : | FT_FINDITH() |
FT_BITCLR( <cByte>, <nBitPos> ) --> cByte
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.
<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. |
See also : | FT_BITSET() FT_ISBIT() |
FT_BITSET( <cByte>, <nBitPos> ) --> cByte
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.
<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. |
See also : | FT_BITCLR() FT_ISBIT() |
FT_BYTEAND( <cByte1>, <cByte2> ) --> cByte
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.
<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. |
See also : | FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG() |
FT_BYTENEG( <cByte> ) --> cNewByte
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.
<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. |
See also : | FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTEAND() |
FT_BYTENOT( <cByte> ) --> cNewByte
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.
<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. |
See also : | FT_BYTEOR() FT_BYTEXOR() FT_BYTENEG() FT_BYTEAND() |
FT_BYTEOR( <cByte1>, <cByte2> ) --> cNewByte
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.
<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. |
See also : | FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND() |
FT_BYTEXOR( <cByte1>, <cByte2> ) --> cNewByte
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.
<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. |
See also : | FT_BYTEOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND() |
FT_FINDITH( <cCheckFor>, <cCheckIn>, <nWhichOccurrence> ; [, <lIgnoreCase> ] ) --> <nStringPosition>
This function finds the position in a string of the "ith" time another string appears in it.
<cCheckFor> | is the string to search for. |
<cCheckIn> | is the string to search. |
<nWhichOccurrence> | is the number of the occurrence to find. |
<lIgnoreCase> | is a logical indicating if the search is to be case sensitive. The default is no case sensitivity (.F.). |
Returns : | The position in the string cCheckIn of the ith occurrence of cCheckFor. |
See also : | FT_AT2() |
FT_ISBIT( <cByte>, <nBitPos> ) --> lResult
Tests for status of any selected bit in the byte passed as a parameter. Byte must be presented in CHR() form, as a literal constant, or as the one-byte character result of an expression.
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.
<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 : | .T. if designated bit is set (1), .F. if not set (0), NIL if invalid parameters. |
See also : | FT_BITSET() FT_BITCLR() |
FT_ISBITON( <nNumber>, <nBit> ) --> lResult
This function is useful when dealing with binary integers. It will come in very handy if you use the FT_INT86() function, because the CPU flags are returned as a series of bits. Using this function, you can determine the state of each CPU flag.
FT_METAPH( <cName> [, <nSize> ] ) --> cMetaPhone
This function is a character function use to index and search for sound-alike or phonetic matches. It is an alternative to the SOUNDEX() function, and addresses some basic pronunciation rules, by looking at surrounding letters to determine how parts of the string are pronounced. FT_METAPH() will group sound-alikes together, and forgive shortcomings in spelling ability.
FT_NOOCCUR( <cCheckFor>, <cCheckIn> ; [, <lIgnoreCase> ] ) --> <nOccurrences>
This function finds the number of times a string occurs in a second string.
FT_PCHR( <cString> ) --> <cPrinterFormat>
This function is useful for allowing the user to enter printer control codes in text (enclosed in double quotes), numeric, hexadecimal, or Epson commands preceded by a slash and returns the printer control code equivalent.
NOTES"
- Combinations of text, numbers, hex, and commands must be separated by commas ("A",27,&1B,/RESET). - Text must be enclosed in double quotes ("x"). - Hexadecimal must be preceded by an ampersand (&1B). - Epson commands, listed below, must be preceded by a forward slash (/RESET).
Epson commands: (slash commands are specific to the Epson)
Job Control:
/RESET or /INIT Reset or initialize the printer /BELL or /BEEP Cause the printer's speaker to beep (not HS) /CAN Clear print buffers (not MX) /SLOW Set low speed mode (not CR, HS, MX) /FAST Cancel low speed mode (not CR, HS, MX) /ONE Select Unidirectional mode /TWO Select Directional mode /ON Activate printer /OFF Turn off printer
/FF or /EJECT Form Feed
Page Control:
/1/6 Set 6 lines per inch /1/8 Set 8 lines per inch /SKIP Set Skip perforation ON /SKIPOFF Set Skip perforation OFF
Font Selection and Manipulation:
/ITALIC Select italic char. set (only FX86, EX, LX, no LQ-1500, SX) /GRAPHIC Select graphic char. set (only FX86, EX, LX, no LQ-1500, SX) /ROMAN Choose Roman font /SANS Choose Sans Serif font /DRAFT Choose draft /NLQ Choose near letter quality /PICA Choose 10 chars per inch /ELITE Choose 12 chars per inch /COND or /SI Choose 15 chars per inch /EMPH Turn emphasize on /EMPHOFF Turn emphasize off /SPANISH Select spanish international char set /USA Select USA international char set
GLOB(<sString>, <sReg>, [<lIgnoreCase>]) --> TRUE || FALSE
GLOB() returns TRUE if string corresponding to regular expression. The expression <sReg> is the simple regular expression by DOS rules.
HARDCR(<cString>) --> cConvertedString
HARDCR() is a memo function that replaces all soft carriage returns (CHR(141)) with hard carriage returns (CHR(13)). It is used to display long character strings and memo fields containing soft carriage returns with console commands. In xClipper, console commands (including REPORT and LABEL FORM) do not automatically convert soft carriage returns to hard carriage returns, making it necessary for you to explicitly make the conversion. Soft carriage returns are added by MEMOEDIT() when lines wrap.
<cString> | is the character string or memo field to be converted. |
Returns : | HARDCR() returns a character string up to 65,535 (64K) characters in length. |
See also : | MEMOTRAN() STRTRAN() |
HASHNAME(<nHashCode>) --> <sStr>
HASHNAME() returns sources string for hash code <nHashCode>.
<nHashCode> | Numeric, is the source hash code. |
Returns : | Returns the string, from what was converted hash code. |
See also : | HASHSTR() |
HASHSTR(<sStr>) --> <nHashCode>
HASHSTR() calulates hash code from string <sStr> and returns it as numeric value <nHashCode>. Hash code has unique values into range of 1000000 to MAX_LONG.
<sStr> | String, is the string to convertion. |
Returns : | Returns the numeric value - hash code, what was converted from string. |
See also : | HASHNAME() |
ISALPHA(<cString>) --> lBoolean
ISALPHA() is a character function that determines if the specified string begins with an alphabetic character. An alphabetic character consists of any uppercase or lowercase letter from A to Z. ISALPHA() returns false (.F.) if the string begins with a digit or any other character.
ISDIGIT(<cString>) --> lBoolean
ISDIGIT() is a character function that determines whether the first character in a string is a numeric digit between zero and nine. If any other character is the first character of the <cString>, ISDIGIT() returns false (.F.).
ISDIGIT() is useful where you need to know if the current character string is a number before converting it to a numeric value with the VAL() function.
ISLOWER(<cString>) --> lBoolean
ISLOWER() is a character function that determines whether the first character of a character string is lowercase. It is the inverse of ISUPPER() which determines whether a character begins with an uppercase character.
Both ISLOWER() and ISUPPER() relate to the LOWER() and UPPER() functions which actually convert lowercase characters to uppercase, and vice versa.
ISUPPER(<cString>) --> lBoolean
ISUPPER() is a character function that determines whether the first character of a string is uppercase. It is the inverse of ISLOWER(). Both ISUPPER() and ISLOWER() relate to the UPPER() and LOWER() functions which actually convert uppercase characters to lowercase, and vice versa.
LEFT(<cString>, <nCount>) --> cSubString
LEFT() is a character function that returns a substring of a specified character string. It is the same as SUBSTR(<cString>, 1, <nCount>). LEFT() is also like RIGHT(), which returns a substring beginning with the last character in a string.
LEFT(), RIGHT(), and SUBSTR() are often used with both the AT() and RAT() functions to locate the first and/or the last position of a substring before extracting it.
<cString> | is a character string from which to extract characters. The maximum size of <cString> is 65,535 (64K) bytes. |
<nCount> | is the number of characters to extract. |
Returns : | LEFT() returns the leftmost <nCount> characters of <cString> as a character string. If <nCount> is negative or zero, LEFT() returns a null string (""). If <nCount> is larger than the length of the character string, LEFT() returns the entire string. |
See also : | AT() LTRIM() RAT() RIGHT() RTRIM() STUFF() SUBSTR() |
LIKE(<sMask>, <sString>) --> TRUE || FALSE
LIKE() returns TRUE if string corresponding to mask. The string <sMask> can contents special symbols: <?>, <*>, <.>
LOWER(<cString>) --> cLowerString
LOWER() is a character function that converts uppercase and mixed case strings to lowercase. It is related to UPPER() which converts lowercase and mixed case strings to uppercase. LOWER() is related to the ISLOWER() and ISUPPER() functions which determine whether a string begins with a lowercase or uppercase letter.
LOWER() is generally used to format character strings for display purposes. It can, however, be used to normalize strings for case- independent comparison or INDEXing purposes.
LTRIM(<cString>) --> cTrimString
LTRIM() is a character function that formats character strings with leading spaces. These can be, for example, numbers converted to character strings using STR().
LTRIM() is related to RTRIM(), which removes trailing spaces, and ALLTRIM(), which removes both leading and trailing spaces. The inverse of ALLTRIM(), LTRIM(), and RTRIM() are the PADC(), PADR(), and PADL() functions which center, right-justify, or left-justify character strings by padding them with fill characters.
MEMOEDIT([<cString>], [<nTop>], [<nLeft>], [<nBottom>], [<nRight>], [<lEditMode>], [<cUserFunction>], [<nLineLength>], [<nTabSize>], [<nTextBufferRow>], [<nTextBufferColumn>], [<nWindowRow>], [<nWindowColumn>]) --> cTextBuffer
<cString> | is the character string or memo field to copy to the MEMOEDIT() text buffer. If not specified, the text buffer is empty. |
<nTop> | , <nLeft>, <nBottom>, and <nRight> are the upper-left and lower-right window coordinates. Row values can range from zero to MAXROW(), and column positions can range from zero to MAXCOL(). If not specified, the default coordinates are 0, 0, MAXROW(), and MAXCOL(). |
<lEditMode> | determines whether the text buffer can be edited or merely displayed. Specifying true (.T.) allows the user to make changes to the text buffer, while specifying false (.F.) only allows the user to browse the text buffer. If not specified, the default value is true (.T.). |
<cUserFunction> | is the name of a user-defined function that executes when the user presses a key not recognized by MEMOEDIT() and when no keys are pending in the keyboard buffer. <cUserFunction> is specified as a character value without parentheses or arguments. Specifying false (.F.) for this argument displays <cString> and causes MEMOEDIT() to immediately terminate. If this argument is specified, the automatic behavior of MEMOEDIT() changes. Refer to the discussion below. |
<nLineLength> | determines the length of lines displayed in the MEMOEDIT() window. If a line is greater than <nLineLength>, it is word wrapped to the next line in the MEMOEDIT() window. If <nLineLength> is greater than the number of columns in the MEMOEDIT() window, the window will scroll if the cursor moves past the window border. If |
<nLineLength> | is not specified, the default line length is (<nRight> - |
<nLeft> | ). |
<nTabSize> | determines the tab stops that will be used when the user presses Tab. If <nTabSize> is not specified, tab stops will be placed at every four characters. |
<nTextBufferRow> | and <nTextBufferColumn> define the display position of the cursor within the text buffer when MEMOEDIT() is invoked. <nTextBufferRow> begins with one (1) and <nTextBufferColumn> begins with zero (0). If these arguments are not specified, the cursor is placed at row one (1) and column zero (0) of the MEMOEDIT() window. |
<nWindowRow> | and <nWindowColumn> define the initial position of the cursor within the MEMOEDIT() window. Row and column positions begin with zero (0). If these arguments are not specified, the initial window position is row zero (0) and the current cursor column position. |
Returns : | MEMOEDIT() returns the text buffer if the user terminates editing with Ctrl+W or a copy of <cString> if user terminates with Esc. |
See also : | LASTKEY() MEMOLINE() MEMOREAD() MEMOTRAN() MEMOWRIT() |
MEMOLINE(<cString>,[<nLineLength>],[<nLineNumber>], [<nTabSize>],[<lWrap>]) --> cLine
MEMOLINE() is a memo function used with MLCOUNT() to extract lines of text from character strings and memo fields based on the number of characters per line. It is the most basic facility provided by xClipper to display memo fields and long strings.
The basic method of operation is to determine the number of lines in the memo field or character string using MLCOUNT() with the same number of characters per line, tab size, and wrapping behavior as you intend to use with MEMOLINE(). Using this value as the upper boundary of a FOR...NEXT, each line of the memo field or character string can be extracted with MEMOLINE() and processed with any combination of output commands and functions required.
<cString> | is the memo field or character string from which a line of text is to be extracted. |
<nLineLength> | specifies the number of characters per line and can be between four and 254. If not specified, the default line length is 79. |
<nLineNumber> | is the line number to be extracted. If not specified, the default value is one. |
<nTabSize> | defines the tab size. If not specified, the default value is four. If <nTabSize> is greater than or equal to <nLineLength>, then the tab size is automatically converted to <nLineLength> - 1. |
<lWrap> | toggles word wrap on and off. Specifying true (.T.) toggles word wrap on; false (.F.) toggles it off. If not specified, the default value is true (.T.). |
Returns : | MEMOLINE() returns the line of text specified by <nLineNumber> in <cString> as a character string. If the line has fewer characters than the indicated length, the return value is padded with blanks. If the line number is greater than the total number of lines in <cString>, MEMOLINE() returns a null string (""). If <lWrap> is true (.T.) and the indicated line length breaks the line in the middle of a word, that word is not included as part of the return value but shows up at the beginning of the next line extracted with MEMOLINE(). If <lWrap> is false (.F.), MEMOLINE() returns only the number of characters specified by the line length. The next line extracted by MEMOLINE() begins with the character following the next hard carriage return, and all intervening characters are not processed. |
See also : | MEMOEDIT() MLCOUNT() MLPOS() |
MEMOREAD(<cFile>) --> cString
MEMOREAD() is a memo function that reads a disk file into memory where it can be manipulated as a character string or assigned to a memo field. MEMOREAD() is used with MEMOEDIT() and MEMOWRIT() to edit an imported disk file, and then write it back to disk. MEMOREAD() searches for <cFile> beginning with the current DOS directory. If the file is not found, MEMOREAD() searches the DOS path. MEMOREAD() does not use the xClipper DEFAULT or PATH to search for <cFile>.
In a network environment, MEMOREAD() attempts to open the specified file shared and read--only. If the file is opened exclusive by another process, MEMOREAD() returns a null string ("").
<cFile> | is the name of the file to read from disk. It must include an extension, if there is one, and can optionally include a path. |
Returns : | MEMOREAD() returns the contents of a text file as a character string. The maximum file size that can be read is 65,535 characters (64K)--the maximum size of a character string. If <cFile> cannot be found, MEMOREAD() returns a null string (""). |
See also : | MEMOEDIT() MEMOWRIT() |
MEMOTRAN(<cString>,[<cReplaceHardCR>],[<cReplaceSoftCR>]) --> cNewString
MEMOTRAN() is a memo function that converts a memo field or long character string containing hard and soft carriage return/line feed characters into a form that can be displayed. These two character combinations are end of line formatting indicators placed in the string by MEMOEDIT(). Soft carriage returns (CHR(141)) are inserted when a line longer than the width of the MEMOEDIT() window wraps. Hard carriage returns (CHR(13)) are inserted when the user explicitly presses Return.
MEMOTRAN() is particularly useful when displaying a memo field in a REPORT FORM which does not wrap when a soft carriage return is encountered. MEMOTRAN() resolves this by converting soft carriage returns to spaces. Note, however, that you must declare MEMOTRAN() as external using the REQUEST statement if it is used in a REPORT FORM and not specified anywhere else in the current program.
<cString> | is the character string or memo field to be searched. |
<cReplaceHardCR> | is the character with which to replace a hard carriage return/line feed pair. If not specified, the default value is a semicolon (;). |
<cReplaceSoftCR> | is the character with which to replace a soft carriage return/line feed pair. If not specified, the default value is a space. |
Returns : | MEMOTRAN() returns a copy of <cString> with the specified carriage return/line feed pairs replaced. |
See also : | STRTRAN() |
MEMOWRIT(<cFile>, <cString>) --> lSuccess
MEMOWRIT() is a memo function that writes a character string or memo field to a disk file. If a path is not specified, MEMOWRIT() writes <cFile> to the current DOS directory and not the current DEFAULT directory. If <cFile> already exists, it is overwritten.
MEMOWRIT() is generally used with MEMOREAD() to load text files into memory where they can be edited, displayed, and written back to disk. You can also use MEMOWRIT() as a quick way of exporting a memo field to a text file.
<cFile> | is the name of the target disk file including the file extension and optional path and drive designator. |
<cString> | is the character string or memo field to write to <cFile>. |
Returns : | MEMOWRIT() returns true (.T.) if the writing operation is successful; otherwise, it returns false (.F.). |
See also : | MEMOEDIT() MEMOREAD() |
MLCOUNT(<cString>, [<nLineLength>],[<nTabSize>], [<lWrap>]) --> nLines
MLCOUNT() is a memo function used with MEMOLINE() to print character strings and memo fields based on the number of characters per line. In the basic operation, use MLCOUNT() to return the number of lines in the character string or memo field. Then, using MEMOLINE() to extract each line, loop through the memo field until there are no lines left.
If <lWrap> is true (.T.) and an end of line position breaks a word, it is word wrapped to the next line and the next line begins with that word. If <lWrap> is false (.F.), MLCOUNT() counts the number of characters specified by <nLineLength> as the current line. The next line begins with the character following the next hard or soft carriage return. Intervening characters are ignored.
<cString> | is the character string or memo field to be counted. |
<nLineLength> | specifies the number of characters per line and can range from four to 254. If not specified, the default line length is 79. |
<nTabSize> | defines the tab size. If not specified, the default value is four. If <nTabSize> is greater than or equal to <nLineLength>, then the tab size is automatically converted to <nLineLength> - 1. |
<lWrap> | toggles word wrap on and off. Specifying true (.T.) toggles word wrap on; false (.F.) toggles it off. If not specified, the default value is true (.T.). |
Returns : | MLCOUNT() returns the number of lines in <cString> depending on the <nLineLength>, the <nTabSize>, and whether word wrapping is on or off. |
See also : | MEMOLINE() MEMOTRAN() MLPOS() |
MLCTOPOS(<cText>, <nWidth>, <nLine>, <nCol>, [<nTabSize>], [<lWrap>]) --> nPosition
MLCTOPOS() is a memo function that determines the byte position that corresponds to a particular line and column within the formatted text. Note that the line number is one-relative and the column number is zero-relative. This is compatible with MEMOEDIT(). The return value is one-relative, making it suitable for use in SUBSTR() or other string functions.
<cText> | is the text string to be scanned. |
<nWidth> | is the line length formatting width. |
<nLine> | is the line number counting from 1. |
<nCol> | is the column number counting from 0. |
<nTabSize> | is the number of columns between tab stops. If not specified, the default is 4. |
<lWrap> | is the word wrap flag. If not specified, the default is true (.T.). |
Returns : | MLCTOPOS() returns the byte position within <cText> counting from 1. |
See also : | MEMOEDIT() MLPOS() MPOSTOLC() |
MLPOS(<cString>, <nLineLength>, <nLine>, [<nTabSize>], [<lWrap>]) --> nPosition
<cString> | is a character string or memo field. |
<nLineLength> | specifies the number of characters per line. |
<nLine> | specifies the line number. |
<nTabSize> | defines the tab size. The default is four. If |
<nTabSize> | is greater than or equal to <nLineLength>, then the tab size is adjusted to <nLineLength> - 1. |
<lWrap> | toggles word wrap on and off. Specifying true (.T.) toggles word wrap on, and false (.F.) toggles it off. The default is true (.T.). |
Returns : | MLPOS() returns the character position of <nLine> in <cString> as an integer numeric value. If <nLine> is greater than the number of lines in <cString>, MLPOS() returns the length of <cString>. |
See also : | MEMOLINE() MEMOTRAN() MLCOUNT() |
MPOSTOLC(<cText>, <nWidth>, <nPos>, [<nTabSize>], [<lWrap>]) --> aLineColumn
MPOSTOLC() is a memo function that determines the formatted line and column corresponding to a particular byte position within <cText>. Note that the line number returned is one-relative and the column number is zero-relative. This is compatible with MEMOEDIT(). <nPos> is one-relative, compatible with AT(), RAT(), and other string functions.
<cText> | is a text string. |
<nWidth> | is the length of the formatted line. |
<nPos> | is the byte position within text counting from one (1). |
<nTabSize> | is the number of columns between tab stops. If not specified, the default is four (4). |
<lWrap> | is the word wrap flag. If not specified, the default is true (.T.). |
Returns : | MPOSTOLC() returns an array containing the line and the column values for the specified byte position, <nPos>. |
See also : | MEMOEDIT() MLCTOPOS() MLPOS() |
PADL(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString PADC(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString PADR(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString
PADC(), PADL(), and PADR() are character functions that pad character, date, and numeric values with a fill character to create a new character string of a specified length. PADC() centers <exp> within <nLength> adding fill characters to the left and right sides; PADL() adds fill characters on the left side; and PADR() adds fill characters on the right side. If the length of <exp> exceeds <nLength>, all of the PAD() functions truncate cPaddedString to <nLength>.
PADC(), PADL(), and PADR() display variable length strings within a fixed length area. They can be used, for instance, to ensure alignment with consecutive ?? commands. Another use is to display text to a fixed- width screen area assuring that previous text is completely overwritten.
PADC(), PADL(), and PADR() are the inverse of the ALLTRIM(), RTRIM(), and LTRIM() functions which trim leading and trailing space from character strings.
<exp> | is a character, numeric, or date value to be padded with a fill character. |
<nLength> | is the length of the character string to be returned. |
<cFillChar> | is the character with which to pad <exp>. If not specified, the default is a space character. |
Returns : | PADC(), PADL(), and PADR() return the result of <exp> as a character string padded with <cFillChar> to a total length of <nLength>. |
See also : | RTRIM() ALLTRIM() LTRIM() |
RAT(<cSearch>, <cTarget>) --> nPosition
RAT() is a character function that returns the position of the last occurrence of a character substring within another character string. It does this by searching the target string from the right. RAT() is like the AT() function, which returns the position of the first occurrence of a substring within another string. RAT() is also like the $ operator, which determines whether a substring is contained within a string.
Both the RAT() and AT() functions are used with SUBSTR(), LEFT(), and RIGHT() to extract substrings.
REPLICATE(<cString>, <nCount>) --> cRepeatedString
REPLICATE() is a character function that repeatedly displays, prints, or stuffs the keyboard with one or more characters. REPLICATE() is like the SPACE() function, which returns a specified number of space characters.
<cString> | is the character string to be repeated. |
<nCount> | is the number of times to repeat <cString>. |
Returns : | REPLICATE() returns a character string up to a maximum of 65,535 (64K) bytes in length. Specifying a zero as the <nCount> argument returns a null string (""). |
See also : | SPACE() |
RIGHT(<cString>, <nCount>) --> cSubString
RIGHT() is a character function that extracts a substring beginning with the rightmost character in <cString>. It is the same as the character expression, SUBSTR(<cString>, <nCount>). For example, RIGHT("ABC", 1) is the same as SUBSTR("ABC", -1). RIGHT() is related to LEFT(), which extracts a substring beginning with the leftmost character in <cString>.
The RIGHT(), LEFT(), and SUBSTR() functions are often used with both the AT() and RAT() functions to locate either the first and/or the last position of a substring before extracting it.
<cString> | is the character string from which to extract characters. |
<nCount> | is the number of characters to extract. |
Returns : | RIGHT() returns the rightmost <nCount> characters of <cString>. If <nCount> is zero, RIGHT() returns a null string (""). If <nCount> is negative or larger than the length of the character string, RIGHT() returns <cString>. The maximum string size is 65,535 (64K) bytes. |
See also : | RTRIM() STUFF() SUBSTR() LEFT() LTRIM() |
[R]TRIM(<cString>) --> cTrimString
RTRIM() is a character function that formats character strings. It is useful when you want to delete trailing spaces while concatenating strings. This is typically the case with database fields which are stored in fixed-width format. For example, you can use RTRIM() to concatenate first and last name fields to form a name string.
RTRIM() is related to LTRIM() which removes leading spaces, and ALLTRIM() which removes both leading and trailing spaces. The inverse of ALLTRIM(), LTRIM(), and RTRIM() are the PADC(), PADR(), and PADL() functions which center, right-justify, or left-justify character strings by padding them with fill characters. RTRIM() is exactly the same as TRIM() in function.
SEARCH(<sPattern>, <sString>, [@aReg], [<nFrom>], [<nRange>]) --> TRUE || FALSE
SEARCH() searches substring into string <sString> by regular expression <sPattern> begin with position <nFrom> and in range <nRange>. The result of search will be wrote to <aReg> if this parameter specified.
<nRange> it is the shifting value, when will be checked concidence about <nFrom>. If <nRange>==0 - checked only position <nFrom>; if <nRange>==1 - checked positions <nFrom> and <nFrom>+1; if <nRange>==-1 - checked positions <nFrom> and <nFrom>-1.
Every element <aReg> is the array of 3 elementes: 1-st element - is the starting position founded substring; 2-d element - is the end founded substring; 3-d element - is the substring length.
SOUNDEX(<cString>) --> cSoundexString
SOUNDEX() is a character function that indexes and searches for sound- alike or phonetic matches. It is used in applications where the precise spelling of character keys is not known or where there is a high probability of misspelled names. Misspelling is common in real-time transaction systems where the data entry operator is receiving information over the telephone. SOUNDEX() works by bringing sound-alikes together under the same key value. Note, however, the soundex method is not absolute. Keys that are quite different can result in the same soundex value.
SPACE(<nCount>) --> cSpaces
SPACE() is a character function that returns a specified number of spaces. It is the same as REPLICATE("", <nCount>). SPACE() can initialize a character variable before associating it with a GET. SPACE() can also pad strings with leading or trailing spaces. Note, however, that the PADC(), PADL(), and PADR() functions are more effective for this purpose.
<nCount> | is the number of spaces to be returned, up to a maximum of 65,535 (64 K). |
Returns : | SPACE() returns a character string. If <nCount> is zero, SPACE() returns a null string (""). |
See also : | PAD() REPLICATE() |
STR(<nNumber>, [<nLength>], [<nDecimals>]) --> cNumber
STR() is a numeric conversion function that converts numeric values to character strings. It is commonly used to concatenate numeric values to character strings. STR() has applications displaying numbers, creating codes such as part numbers from numeric values, and creating index keys that combine numeric and character data.
STR() is like TRANSFORM(), which formats numeric values as character strings using a mask instead of length and decimal specifications.
The inverse of STR() is VAL(), which converts character numbers to numerics.
<nNumber> | is the numeric expression to be converted to a character string. |
<nLength> | is the length of the character string to return, including decimal digits, decimal point, and sign. |
<nDecimals> | is the number of decimal places to return. |
Returns : | STR() returns <nNumber> formatted as a character string. If the optional length and decimal arguments are not specified, STR() returns the character string according to the rules. |
See also : | TRANSFORM() VAL() |
STR2VAR(<sUucodeStr>) --> <vData>
STR2VAR() deconverts uucode string <sUucodeStr> to source data <vData> to uucode string and returns it. This function is conversely for VAR2STR() function.
<sUucodeStr> | String, is the source uucode string. |
Returns : | Returns some data wath equal source uucode string <sUucodeStr>. |
See also : | STR2VAR() |
STRTRAN(<cString>, <cSearch>,[<cReplace>], [<nStart>], [<nCount>]) --> cNewString
STRTRAN() is a character function that performs a standard substring search within a character string. When it finds a match, it replaces the search string with the specified replacement string. All instances of <cSearch> are replaced unless <nStart> or <nCount> is specified. Note that STRTRAN() replaces substrings and, therefore, does not account for whole words.
<cString> | is the character string or memo field to be searched. |
<cSearch> | is the sequence of characters to be located. |
<cReplace> | is the sequence of characters with which to replace |
<cSearch> | . If this argument is not specified, the specified instances of the search argument are replaced with a null string (""). |
<nStart> | is the first occurrence that will be replaced. If this argument is omitted, the default is one. If this argument is equal to or less than zero, STRTRAN() returns an empty string. |
<nCount> | is the number of occurrences to be replaced. If this argument is not specified, the default is all. |
Returns : | STRTRAN() returns a new character string with the specified instances of <cSearch> replaced with <cReplace>. |
See also : | RAT() STUFF() SUBSTR() AT() |
STUFF(<cString>, <nStart>, <nDelete>, <cInsert>) --> cNewString
STUFF() is a character function that deletes <nDelete> characters from <cString> beginning at the <nStart> position. Then, it inserts <cInsert> into the resulting string beginning at <nStart> to form the return string. With this, STUFF() can perform the following six operations:
Insert: If <nDelete> is zero, no characters are removed from <cString>. <cInsert> is then inserted at <nStart>, and the entire string is returned. For example, STUFF("My dog has fleas.", 12, 0, "no" ) returns "My dog has no fleas."
Replace: If <cInsert> is the same length as <nDelete>, <cInsert> replaces characters beginning at <nStart>. The same number of characters are deleted as are inserted, and the resulting string is the same length as the original. For example, STUFF("My dog has fleas.", 12, 5, "bones") returns "My dog has bones."
Delete: If <cInsert> is a null string (""), the number of characters specified by <nDelete> are removed from <cString>, and the string is returned without any added characters. For example, STUFF("My dog has fleas.", 1, 3, "") returns "dog has fleas."
Replace and insert: If <cInsert> is longer than <nDelete>, all characters from <nStart> up to <nDelete> are replaced and the rest of <cInsert> is inserted. Since more characters are inserted than are deleted, the resulting string is always longer than the original. For example, STUFF("My dog has fleas.", 8, 3, "does not have") returns "My dog does not have fleas."
Replace and delete: If the length of <cInsert> is less than <nDelete>, more characters are deleted than inserted. The resulting string, therefore, is shorter than the original. For example, STUFF("My dog has fleas.", 8, 3, "is") returns "My dog is fleas."
Replace and delete rest: If <nDelete> is greater than or equal to the number of characters remaining in <cString> beginning with <nStart>, all remaining characters are deleted before <cInsert> is inserted. For example, STUFF("My dog has fleas.", 8, 10, "is.") returns "My dog is."
<cString> | is the target character string into which characters are inserted and deleted. |
<nStart> | is the starting position in the target string where the insertion/deletion occurs. |
<nDelete> | is the number of characters to be deleted. |
<cInsert> | is the string to be inserted. |
Returns : | STUFF() returns a copy of <cString> with the specified characters deleted and with <cInsert> inserted. |
See also : | RAT() RIGHT() STRTRAN() SUBSTR() AT() LEFT() |
SUBSTR(<cString>, <nStart>, [<nCount>]) --> cSubstring
SUBSTR() is a character function that extracts a substring from another character string or memo field. SUBSTR() is related to the LEFT() and RIGHT() functions which extract substrings beginning with leftmost and rightmost characters in <cString>, respectively.
The SUBSTR(), RIGHT(), and LEFT() functions are often used with both the AT() and RAT() functions to locate either the first and/or the last position of a substring before extracting it. They are also used to display or print only a portion of a character string.
<cString> | is the character string from which to extract a substring. It can be up to 65,535 (64K) bytes, the maximum character string size in xClipper. |
<nStart> | is the starting position in <cString>. If <nStart> is positive, it is relative to the leftmost character in <cString>. If |
<nStart> | is negative, it is relative to the rightmost character in the |
<cString> | . |
<nCount> | is the number of characters to be extracted. If omitted, the substring begins at <nStart> and continues to the end of the string. If <nCount> is greater than the number of characters from <nStart> to the end of <cString>, the excess numbers are ignored. |
Returns : | SUBSTR() returns a character string. |
See also : | RAT() RIGHT() STR() AT() LEFT() |
TRIM(<cString>) --> cTrimString
TRIM() is a character function that formats character strings. It is useful when you want to delete trailing spaces while concatenating strings. This is typically the case with database fields which are stored in fixed-width format. For example, you can use TRIM() to concatenate first and last name fields to form a name string.
TRIM() is related to LTRIM(), which removes leading spaces, and ALLTRIM(), which removes both leading and trailing spaces. The inverse of ALLTRIM(), LTRIM(), and RTRIM() are the PADC(), PADR(), and PADL() functions which center, right-justify, or left-justify character strings by padding them with fill characters.
UPPER(<cString>) --> cUpperString
UPPER() is a character function that converts lowercase and mixed case strings to uppercase. It is related to LOWER() which converts uppercase and mixed case strings to lowercase. UPPER() is related to the ISUPPER() and ISLOWER() functions which determine whether a string begins with an uppercase or lowercase letter.
UPPER() is generally used to format character strings for display purposes. It can, however, be used to normalize strings for case- independent comparison or INDEXing purposes.
VAL(<cNumber>) --> nNumber
VAL() is a character conversion function that converts a character string containing numeric digits to a numeric value. When VAL() is executed, it evaluates <cNumber> until a second decimal point, the first non-numeric character, or the end of the expression is encountered. Leading spaces are ignored. When SET FIXED is ON, VAL() returns the number of decimal places specified by SET DECIMALS, rounding <cNumber> if it is specified with more digits than the current DECIMALS value. As with all other functions that round, digits between zero and four are rounded down, and digits between five and nine are rounded up. When SET FIXED is OFF, VAL() returns the number of decimal places specified in <cNumber>.
VAL() is the opposite of STR() and TRANSFORM(), which convert numeric values to character strings.
<cNumber> | is the character expression to be converted. |
Returns : | VAL() returns <cNumber> converted to a numeric value including decimal digits. |
See also : | ROUND() STR() TRANSFORM() |
VAR2STR(<vData>) --> <sUucodeStr>
VAR2STR() converts source data <vData> to uucode string <sUucodeStr> and returns it.
<vData> | Data to convert. |
Returns : | Returns uucode string <sUucodeStr>. |
See also : | STR2VAR() |