410
CVS( ) Function
Convert String
Formats
1. Reformat String: CVS(data$,[cvs_code[:ctl_char$],...][,ERR=stmtref])
2. Return Accent Table: CVS(*)
Where:
*
Asterisk. Returns the current 256-byte accent translation table.
ctl_char$ Optional control character. String expression. Default: blank character
cvs_code Conversion type. Numeric expression. See the chart below.
data$
Data to convert. String expression.
stmtref
Program line number or label to transfer control to.
Returns
Converted value of string expression, or accent translation table.
Description
The CVS( ) function converts a string of data to different forms based on the numeric
values used for cvs_code (e.g., to convert to upper case, stripped string, etc). The
numeric expression tells ProvideX the type of conversion to perform. If you append
a colon ":" and string value, the control character used in the conversion will be the
first character of the string. Otherwise, it will be a space.
You can also use the function to return the current accent translation table and do translations
The value of cvs_code is made up of a series of binary values indicating:
Value
Conversion to Take Place:
Strip leading control characters
1
Strip trailing control characters
2
Convert string to upper case
4
Convert string to lower case
8
Replace non-printable characters with the control character
16
Replace multiple occurrences of the character with one
32
Replace $ with a defined currency symbol, comma with a defined
64
thousands separator, and period with a defined decimal point. See also,
Replace a defined currency symbol, thousands separator and decimal point
128
with $, comma, and period respectively (inverse of value 64 above).