# DEF CVS/DTE/LCS/UCS Define System Tables

> Source: https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs

## Formats

|  |  |  |
| --- | --- | --- |
| 1\. | [Define Accent Conversion](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs#Mark5)*:* | **DEF CVS**(*new_table$)* |
| 2\. | [Define Date Table](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs#Mark7)*:* | **DEF DTE**(*new_table$)* |
| 3\. | [Define Lowercase Table:](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs#Mark9) | **DEF LCS**(*new_table$*) |
| 4\. | [Define Uppercase Table:](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs#Mark9) | **DEF UCS**(*new_table$*) |
| 5\. | [Define Separators Table:](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs#Mark9) | **DEF SEP**(*new_table$*) |
| 6\. | [Define Printable Character Table:](https://manual.pvxplus.com/directives/def-cvs-dte-lcs-ucs#Mark9) | **DEF CHR**(*new_table$*) |

***Where:***

|  |  |
| --- | --- |
| *new_table$* | String expression. Contains the new definition (contents) of the table. |

## Description

Use these **DEF** directives to define new system tables for *Accent Conversion*, *Date*, *Lowercase* and *Uppercase*.

## Format 1

***Define Accent Translation Table***  
  
Use the **DEF CVS** directive to set the values for the accent conversion table. The value of each byte to be translated is used as an offset into the table. The character at the particular offset is used in place of the original character.

See the "T" option under **[Key Definition Attributes](https://manual.pvxplus.com/directives/keyed#Mark3)**, as well as the [CVS( )](https://manual.pvxplus.com/functions/cvs) function.

## Format 2

***Define Date Table***

The **DEF DTE** directive uses a string made up of 46 comma-delimited fields. These fields are used by the **DTE** function and should have the following values:

|  |  |
| --- | --- |
| **Number of Fields** | **Field Contents** |
| 12 | Long form month names (%Ml) |
| 7 | Long form day names (%Dl) |
| 2 | Long form lowercase am/pm (%pl) |
| 2 | Long form uppercase AM/PM (%Pl) |
| 12 | Short form month names (%Ms) |
| 7 | Short form day names (%Ds) |
| 2 | Short form lowercase am/pm (%ps) |
| 2 | Short form uppercase AM/PM (%Ps) |

## Formats 3 and 4

***Define Lowercase and Uppercase Tables***

The **DEF LCS** and **DEF UCS** directives both take a 256-character string and replace the standard case conversion table with the string's value. Whenever PxPlus converts the case of a character, it uses the character's binary value as an offset into the tables.

Warning!  
*Be careful* when changing the UCS conversion table because the PxPlus compiler uses this table to convert keywords to uppercase before scanning its syntax tables. If you define an incorrect table, you may be unable to enter any subsequent commands in PxPlus. See [Reserved Words](https://manual.pvxplus.com/appendix/reserved-words).

## Format 5

***Define Separator Table***

Use the DEF SEP(\<string>) directive to define a list of potential field separators.

***Example:***

DEF SEP($8A0A$) tells the system to accept either an $8A$ or $0A$ as the field separator.

When issuing the **DEF SEP** directive, the first character will become the system DEFAULT field separator.

Only ***one*** separator can be used at a time when parsing the data; that is, when the data is processed in the **READ DATA FROM** directive, it is first scanned to determine which, if any, of the field separator characters exist in the data. This scan is done initially with the first character in the separator list and, if not found in the data, the second character is checked and so on.

The currently defined field separators can be retrieved by accessing **SEP(\*)**.

## Format 6

***Define Printable Character Table***

This option allows the user to define which characters are "printable" for use with the **CVS( )** function value 16.

To define which characters are "printable", the programmer can issue a DEF CHR(\<string>) directive passing a string of 256 bytes. Each byte must be a $00$ or $01$ where $01$ indicates a printable character and $00$ indicates non-printable.

The current table of printable characters can be found by accessing **CHR(\*)**.

*(The ability to define the "Printable" characters was added in PxPlus v7.00.)*

## See Also

[CHR( ) ASCII Character of Value](https://manual.pvxplus.com/functions/chr)  
[CVS( ) Convert String](https://manual.pvxplus.com/functions/cvs)  
[DTE( ) Convert Date](https://manual.pvxplus.com/functions/dte)  
[LCS( ) Return Lowercase String](https://manual.pvxplus.com/functions/lcs)  
[SEP( ) Return Field Separator](https://manual.pvxplus.com/functions/sep)  
[UCS( ) Return Uppercase String](https://manual.pvxplus.com/functions/ucs)
