1830240 Members
2010 Online
109999 Solutions
New Discussion

PCL

 
SOLVED
Go to solution
Alexander Fung
New Member

PCL

1. I would like to know how I can create a "ESC" character under EVE mode.
2. within my application program "C", how I can kick off MICR font.
Thank you.
4 REPLIES 4
Dale A. Marcy
Trusted Contributor

Re: PCL

For item 1, one way is to SET KEYPAD EDT using the DO key. Then do a 27. The key is usually one of the following three keys depending on what you are connected with: , , or . The is the 3 located on the keypad at the right of the keyboard. There are ways to include the key definition into your tpu, but I do not remember how.
Dale A. Marcy
Trusted Contributor

Re: PCL

Another way to accomplish the "ESC" character would be to edit an empty file (escape.tpu as a suggestion) and enter the following lines:

PROCEDURE eve_dam_insert_escape
LOCAL curr_range;

curr_range := COPY_TEXT(ASCII(27));
POSITION(END_OF(curr_range));
MOVE_HORIZONTAL(1);

ENDPROCEDURE;

After entering the above, press the DO key and enter EXTEND TPU * and press return. You can then define a key to be dam_insert_escape and it will insert the escape character whenever typed in that session. To keep it across sessions, you need to save the tpu section file and use it again when you invoke the editor. I borrowed the above from some other code I have, so I don't remember what each of the lines does. I haven't extended my tpu section file in many years. The 27 is the ASCII value in decimal of the ESC character. The letters dam in the above are just my initials and can be replaced with any other character string. The main intent is to ensure the string is unique and does not replace another built in function by accident.
John Gillings
Honored Contributor

Re: PCL

Alexander,

In EVE, the easiest way to enter many control characters is with "QUOTE" command: ^V. For escape, type ^V then ^[ (ie: hold the Ctrl key down, then type V then [). Depending on your terminal or terminal emulator, the character will appear as a grey block, a backwards question mark or an "esc" glyph.

QUOTE allows you to insert most control characters. The only exceptions are characters that are interpreted by the terminal driver, ^Y, ^C, ^S, ^Q, ^O etc...

Hit the DO key and type HELP QUOTE for more details.

To insert any character, regardless of terminal drivers and other out of band mechanisms, use the EVE$INSERT_TEXT routine and the ASCII function. For example, to insert ^Y, hit DO then:

Command: TPU EVE$INSERT_TEXT(ASCII(25))
A crucible of informative mistakes
Antoniov.
Honored Contributor
Solution

Re: PCL

Alexander,
welcome invms forum :-)

If your application is C program use \e sequence to create escape code; e.g.
esc = '\e';
myString = "\e[0m";

About PCL font you can use ESC ( id form primary font and ESC ) id for secondary font, where
ESC is escape code
( is left paren char
id is font identifier.
Font id is printer dependent; most common are:
0N -> ISO Latin1
8U -> PC-8

Antonio Vigliotti
Antonio Maria Vigliotti