RS/2 scripts are text files that must start with the line

// REDTITAN RS2 CONTROL

The RS/2 program should signal the end of file condition to EscapeE. using a HALT function with an error code greater than 0

Example

// REDTITAN RS2 CONTROL

text(600,600,'This is page '+paramstr(1));

if paramstr(1)='5' then halt(1);

The example above will create a 5 page file when it is opened by EscapeE. See RS/2 procedures for a list of the built-in standard functions and procedures.

An RS/2 file may be created with a simple text editor. The RS/2 file encoding format is UTF8. A plain text file is acceptable if the source text only contains characters in the ASCII character range $00 to $7F. If string constants contain characters outside this range or you wish to include other symbols then use a text editor that will display these characters (e.g. Microsoft® Notepad); select Save As... from the File menu and set the Encoding to UTF-8. A UTF-8 file will start with a sequence of special Byte Order Marks and UNICODE sequences will be encoded in UTF8 format. The RS/2 compiler can detect and repair some encoding problems automatically.

The Pound signs will be displayed correctly:

Example

// REDTITAN RS2 CONTROL

flash('££'); // Although these characters are ASCII $A3 (outside the $00-$7F range)

halt(1);     // This file may be stored in plain text format

Greek letters, for example, will not be correct unless the source file has been stored in UTF-8 encoding

Example

// REDTITAN RS2 CONTROL

flash('ΩΧΦ'); // These characters are UNICODE $03A9 $03A7 $03A6

halt(1);     // This file should be stored in UTF-8 format

To learn more about UTF-8 see http://www.pcl.to/unicode/utf.xml

To automate the entry of unicode characters in simple editors like Notepad, download the RedTitan Autoclick utility – see http://www.pcl.to/unicode/