Operating System - OpenVMS
1748213 Members
3009 Online
108759 Solutions
New Discussion юеВ

Putting ESCAPE codes into a file

 
SOLVED
Go to solution
Jennifer Werner
Occasional Contributor

Putting ESCAPE codes into a file

Is anyone out there able to tell me how to put an ESCAPE code into a file.
An ESCAPE P code is needed to make a DYMO label printer use a 16point font.
6 REPLIES 6
Karl Rohwedder
Honored Contributor
Solution

Re: Putting ESCAPE codes into a file

If you use EDT e.g. its:

27

>KP3> is called 'special insert' and 27 is the ascii code (in decimal) for .

regards Kalle

P.S. is the PF1 key and the 3 on the right edit keyboard.
Hein van den Heuvel
Honored Contributor

Re: Putting ESCAPE codes into a file

In EDT (EDITx/EDT) I just hit escape twice.
That'll do it.
That trick also allows you so 'see' escape sequences as issued by keystrokes.
For example, hit escape, followed by 'page-down' and you see: [6~


in TPU use: TPU COPY_TEXT(ASCII(27)


in DCL:

$ x = "x"
$ x[0,8] = 27
$ open/appe tmp tmp.tmp
$ write tmp x
$ dump/rec tmp.tmp
:
Record number 6 (00000006), 1 (0001) byte, RFA(0001,0000,0066)
1B ................................ 000000


Enjoy!

Hein.

John Gillings
Honored Contributor

Re: Putting ESCAPE codes into a file

In TPU (EVE), use ^V (Control V) to enter control characters into a file from the keyboard. The next character typed will be entered as text. It works for most control keys - I think the only ones excluded are ^S and ^Q.

The sequence ^V ^[ (Control V then Control [) will enter an escape character.
A crucible of informative mistakes
Robert Gezelter
Honored Contributor

Re: Putting ESCAPE codes into a file

Jennifer,

Do you need a one-shot? In which case EDT/TPU will do. Or, is the need for an ongoing creation of new files.

In the latter case, all of the languages have their own specific syntax for representing non-printable characters (e.g., ESCAPE).

In DCL, the assignment statements (=,==) have the square brackets syntax, to wit:

$ ESCAPE_CHARACTER_STRING[0,8] = 27

You will find examples of this syntax in files in SYS$EXAMPLES.

- Bob Gezelter, http://www.rlgsc.com
The Brit
Honored Contributor

Re: Putting ESCAPE codes into a file

Jennifer,
If you are inserting these characters into a DCL script, then the best approach is that described by Hein. If you don't do it this way, you will have fun trying to print the script because the escape characters will be translated in the process. Here is how I do it.

$ ESC[0,7] = 27
$ Bold = ESC + "[1;1m" ! Bold Text
$ Rev = ESC + "[7;1m" ! Reverse Video
$ Norm = ESC + "[0m" ! Back to normal

$ Write sys$output "''ESC'[17;9f" ! Move the cursor to Line 17, Column 9.

etc, etc.

Dave.
Jennifer Werner
Occasional Contributor

Re: Putting ESCAPE codes into a file

Within minutes of the post I had helpful replies. The replies DID lead to the solution!
I just had to open a file with EDT (which I never use), press the ESC key twice and then press the letter of the escape code and save the file.
Then I had to use the following print command...
PRINT UT:LABUPITCH.COM /QUE=LABEL_TEST2
which sends the escape code.
Then print the file as usual.