11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHARS<br />

Syntax<br />

CHARS(array)<br />

Description<br />

The <strong>UniBasic</strong> CHARS function changes a numeric value in array to its ASCII<br />

(American Standard Code for Information Interchange) character string equivalent.<br />

array elements can contain a constant, variable, numeric function, or any combination<br />

of these. array elements must evaluate to a positive number 0–255 (the range<br />

of ASCII character codes). CHARS supports multibyte languages.<br />

Not all ASCII codes are printable. Some represent terminal controls, and others are<br />

reserved for special uses. For more information about ASCII character codes, see<br />

Appendix A, “ASCII Character Codes.”<br />

Tip: Use @variables to represent UniData delimiters and the null value. IBM<br />

recommends that you not use the <strong>UniBasic</strong> functions CHAR or CHARS to insert these<br />

variables because the ASCII code that represents it varies with language group.<br />

Example<br />

In the following example, the program segment assigns the ASCII string equivalent<br />

of the elements of array VAL to the variable VARRAY. VARRAY now contains<br />

W}X}Y}Z, the character equivalent of 87,88,89, and 90 in the ASCII code system.<br />

VAL = 87:@VM:88:@VM:89:@VM:90<br />

VARRAY = CHARS(VAL)<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

ASCII, CHAR, EBCDIC, SEQ<br />

CHARS 1-138

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!