13.11. STRING

About
Functions order

13.11.1. About STRING

13.11.2. STRING functions order

ADDSLASHES() Returns string with slashes (\).
ALLTRIM() Remove leading and trailing spaces from a character string
ASC() Convert a character to its ASCII value
AT() Return the position of a substring within a character string
BETWEEN() Check value.
BUNZIP2() Uncompress string with BZIP2 alghoritm.
BZIP2() Compress string with bZIP2 alghoritm.
CHR() Convert an ASCII code to a character value
CSCOUNT() Returns the number specified chars into source string.
DSTRTON() Convert string as "double" to xClipper-numeric.
EMPTY() Determine if the result of an expression is empty
FSTRTON() Convert string as "float" to xClipper-numeric.
FT_AT2() Find position of the nth occurrence of a substring
FT_BITCLR() Clear (reset) selected bit in a byte
FT_BITSET() Set selected bit in a byte
FT_BYTEAND() Perform bit-wise AND on two ASCII characters (bytes)
FT_BYTENEG() Perform bit-wise negation on an ASCII character
FT_BYTENOT() Perform bit-wise NOT on an ASCII character (byte)
FT_BYTEOR() Perform bit-wise OR on two ASCII characters (bytes)
FT_BYTEXOR() Perform bit-wise XOR on two ASCII characters (bytes)
FT_FINDITH() Find the "ith" occurrence of a substring within a string
FT_ISBIT() Test the status of an individual bit
FT_ISBITON() Determine the state of individual bits in a number
FT_METAPH() Convert a character string to MetaPhone format
FT_NOOCCUR() Find the number of times one string occurs in another
FT_PCHR() Convert printer control codes
GLOB() Check confirmity string to regular expression.
GUNZIP() Uncompress string with GZIP alghoritm.
GZIP() Compress string with GZIP alghoritm.
HARDCR() Replace all soft carriage returns in a character string with hard carriage
HASHNAME() Returns string from hash values.
HASHSTR() Returns hash code for string.
ISALPHA() Determine if the leftmost character in a string is alphabetic
ISDIGIT() Determine if the leftmost character in a character string is a digit
ISLOWER() Determine if the leftmost character is a lowercase letter
ISUPPER() Determine if the leftmost character in a string is uppercase
LEFT() Extract a substring beginning with the first character in a string
LEN() Return the length of a character string or the number of elements in an array
LIKE() Check confirmity string to simple mask.
LOWER() Convert uppercase characters to lowercase
LTRIM() Remove leading spaces from a character string
MEMOEDIT() Display or edit character strings and memo fields
MEMOLINE() Extract a line of text from a character string or memo field
MEMOREAD() Return the contents of a disk file as a character string
MEMOTRAN() Replace carriage return/linefeeds in character strings
MEMOWRIT() Write a character string or memo field to a disk file
MLCOUNT() Count the number of lines in a character string or memo field
MLCTOPOS() Return the byte position of a formatted string based on line and column
MLPOS() Determine the position of a line in a character string or memo field
MPOSTOLC() Return line and column position of a formatted string based on a specified
PAD() Pad character, date, and numeric values with a fill character
QOUT() Display a list of expressions to the console
RAT() Return the position of the last occurrence of a substring
REPLICATE() Return a string repeated a specified number of times
RIGHT() Return a substring beginning with the rightmost character
RTRIM() Remove trailing spaces from a character string
SEARCH() Search a substring into string by regular expression.
SOUNDEX() Convert a character string to "soundex" form
SPACE() Return a string of spaces
STR() Convert a numeric expression to a character string
STR2VAR() Convert uucode string to data.
STRTRAN() Search and replace characters within a character string or memo field
STUFF() Delete and insert characters in a string
SUBSTR() Extract a substring from a character string
TRANSFORM() Convert any value into a formatted character string
TRIM() Remove trailing spaces from a character string
TYPE() Determine the type of an expression
UPPER() Convert lowercase characters to uppercase
VAL() Convert a character number to numeric type
VALTYPE() Determine the data type returned by an expression
VAR2STR() Convert data to uucode string.
WEIGHTASC() Returns the weight characterics of character.
WEIGHTTABLE() Returns the weight table of characters.

13.11.2.23. Function FT_PCHR()

 FT_PCHR( <cString> )  ->  <cPrinterFormat>

13.11.2.23.3. Description

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

13.11.2.36. Function MEMOEDIT()

 MEMOEDIT([<cString>],
 [<nTop>], [<nLeft>],
 [<nBottom>], [<nRight>],
 [<lEditMode>],
 [<cUserFunction>],
 [<nLineLength>],
 [<nTabSize>],
 [<nTextBufferRow>],
 [<nTextBufferColumn>],
 [<nWindowRow>],
 [<nWindowColumn>]) --> cTextBuffer

13.11.2.36.1. Arguments

<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.

13.11.2.37. Function MEMOLINE()

 MEMOLINE(<cString>,[<nLineLength>],[<nLineNumber>],
 [<nTabSize>],[<lWrap>]) --> cLine

13.11.2.38. Function MEMOREAD()

 MEMOREAD(<cFile>) --> cString

13.11.2.39. Function MEMOTRAN()

 MEMOTRAN(<cString>,[<cReplaceHardCR>],[<cReplaceSoftCR>]) --> cNewString

13.11.2.41. Function MLCOUNT()

 MLCOUNT(<cString>, [<nLineLength>],[<nTabSize>], [<lWrap>]) --> nLines

13.11.2.44. Function MPOSTOLC()

 MPOSTOLC(<cText>, <nWidth>, <nPos>, [<nTabSize>], [<lWrap>]) --> aLineColumn

13.11.2.45. Function PAD()

 PADL(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString
 PADC(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString
 PADR(<exp>, <nLength>, [<cFillChar>]) --> cPaddedString

13.11.2.48. Function RIGHT()

 RIGHT(<cString>, <nCount>) --> cSubString

13.11.2.49. Function RTRIM()

 [R]TRIM(<cString>) --> cTrimString

13.11.2.53. Function STR()

 STR(<nNumber>, [<nLength>], [<nDecimals>]) --> cNumber

13.11.2.55. Function STRTRAN()

 STRTRAN(<cString>, <cSearch>,[<cReplace>], [<nStart>], [<nCount>]) --> cNewString

13.11.2.56. Function STUFF()

 STUFF(<cString>, <nStart>,	<nDelete>, <cInsert>) --> cNewString

13.11.2.56.3. Description

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."

13.11.2.57. Function SUBSTR()

 SUBSTR(<cString>, <nStart>, [<nCount>]) --> cSubstring

13.11.2.58. Function TRIM()

 TRIM(<cString>) --> cTrimString

13.11.2.59. Function UPPER()

 UPPER(<cString>) --> cUpperString

13.11.2.60. Function VAL()

 VAL(<cNumber>) --> nNumber