Language Reference

BYTE Function

translates numbers to ordinal characters

BYTE( matrix)

where matrix is a numeric matrix or literal.

The BYTE function returns a character matrix with the same shape as the numeric argument. Each element of the result is a single character with an ordinal position in the computer's character set that is specified by the corresponding numeric element in the argument. These numeric elements should generally be in the range 0 to 255.

For example, in the ASCII character set, the following two statements are equivalent:

  
    a=byte(47);
 

  
    a="/";       /* the slash character */
 

The lowercase alphabet can be generated with the following statement:

  
    y=byte(97:122);
 

This statement produces the following matrix:

  
       Y             1 row      26 cols    (character, size 1) 
  
       a b c d e f g h i j k l m n o p q r s t u v w x y z
 
This function simplifies the use of special characters and control sequences that cannot be entered directly into IML source code by using the keyboard. Consult the character set tables for the computer you are using to determine the printable and control characters that are available and their ordinal positions.

Previous Page | Next Page | Top of Page