Codes (character data)

<< Click to Display Table of Contents >>

Navigation:  User guide > Data >

Codes (character data)

With RCP UNITEXT any character can be used.

If not using UNITEXT the following applies:

When reading or writing character data each position can contain any ASCII character (value 0 to 255). Normally this will be numbers 0-9 or letters A-Z (or a-z) with perhaps punctuation characters and blank spaces.

Internally within CL the ASCII characters are stored as 1 or more codes. Each data location can contain up to 12 codes, known by the names VX0123456789. Each of the 256 ASCII characters is represented as a combination of one or more codes.

Fortunately, the ASCII characters for digits 0 - 9 are converted to codes 0 - 9. All other ASCII characters are not so easy to remember so the ASCII character is placed within quotes in CL scripts. For example:

$34/'A'

will test for the codes which represent the character A (upper case) in location 34. Without the quotes a code (VX0123456789) is expected.

Be very careful with:

$240/V

and

$240/'V'

The first checks whether a V code is present and the second whether the letter V is present. When processing character data which may contain anything other than numbers it is best to use quotes when testing contents of locations.