System Functions
CVS( ) Convert String
   
Formats 1. Reformat String: CVS(data$,[cvs_code[:ctl_char$],...][,ERR=stmtref])
2. Return Accent Table: CVS( * )
3. Return Character String: CVS( num_val, num_val, num_val, ... )
 
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.
num_val Numeric values of the characters to be converted into a string.
stmtref Program line number or statement label to which to transfer control.

 

   
Returns Converted value of string expression, or accent translation table.
   
Format 1 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 based on it. For more information, refer to the DEF CVS/DTE/LCS/UCS Directives. The value of cvs_code is made up of a series of binary values indicating:

Value Conversion to Take Place:
1 Strip leading control characters
2 Strip trailing control characters
4 Convert string to upper case
8 Convert string to lower case
16 Replace non-printable characters with the control character
32 Replace multiple occurrences of the character with one
64 Replace $ with a defined currency symbol, comma with a defined thousands separator, and period with a defined decimal point. See also,

'CU'= System Parameter,
'DP'= System Parameter,
'TH'= System Parameter

128 Replace a defined currency symbol, thousands separator and decimal point with $, comma, and period respectively (inverse of value 64 above).
256 Convert string to mixed case (first letter of each word is upper case, the rest of the letters are lower case).
512 Translate the string expression provided in data$ based on the current accent translation table.
   
Examples
PRINT "|",CVS(" The Cat ",1:" "),"|" yields |The Cat |
PRINT "|",CVS(" The Cat ",2:" "),"|" yields |The Cat|
PRINT "|",CVS(" The Cat ",39),"|" yields |THE CAT|
Note: 32+4+2+1=39 (you can use a sum)
PRINT CVS("$$$123",32:"$") yields $123
   
See Also STP( ) Strip Leading/Trailing Characters,
LCS( ) Return Lowercase String,
UCS( ) Return Upper Case String.
   
Format 2 The CVS( * ) returns a 256 byte string consisting of the character mapping table used for Accented characters. Each byte in the table represents the character that the system use when appying the Accented character mapping for keyed files.

For example if the character  is found in the text, its binary value (194 - Hex $C2$) will be used as the offset into the mapping table. For purposes of computing the offset, the first character in the table is considered offset 0, the second offset 1, and so on thus a  will be substituted with the character at position 195 in the string.

   
Format 3 The CVS( ) function can also be used to return a character string based on a series of numeric values. When using format 3, each numeric value passed is considered to be the binary UNICODE value for each character in the string to be returned.

For example the value of CVS(77,105,107,101) will return the sting "Mike" since the binary value of "M" is 77, "i" is 105, etc. Or in other words:

CVS(77,105,107,101) = CHR(77)+CHR(105)+CHR(107)+CHR(101)

The primary purpose of this function is to provide for the easy conversion of UNICODE data into UTF-8.

This CVS function capability is +PxPlus Exclusive