Subject: | |
From: | |
Reply To: | |
Date: | Wed, 11 Dec 1996 19:58:18 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Curt Brimacomb wrote:
> I have a programmer here who (in cobol) want to be able to send escape
> sequences using the hex code for it. He knows decimal (pic s9(4) comp
> value 27) and octal (pic x value %33).
If you do your "decimal", redefine it as pic x filler, pic x esc-code,
then use "esc-code"; otherwise you get a leading null (you may not
want).
Easiest way is either do something like:
DISPLAY %33 "H" %33 "JTop line of a cleared screen". (for terminal)
or STRING %33 "H" %33 "JTop line of a cleared screen"
DELIMITED BY SIZE INTO some-record-buffer, (for file buffer)
Also, if you have a large block of codes you want to define in a lazy
manner, you can do something like:
01 SOME-LENGTHY-SEQUENCE.
02 FILLER PIC X(nn)
VALUE "$H$J$&dBHeading line...".
declare your "escape" chars with a substitute character (a '$' above)
and in your program initialization add a:
EXAMINE[/INSPECT] some-lengthy-sequence replacing all "$" by %33.
I have used this method to define custom f-key definitions, enabling me
to define the values on consecutive, single lines as 02-levels under a
grouping 01-name (makes it easy to edit and read). You can then set the
label definitions with a single "DISPLAY the-01-dataname" instead of a
less efficient scheme to write individual key definitions.
Those methods work, but I don't know of an "escaping" mechanism within a
literal like C, such as printf("\033H\033JHello World"), you have to go
to some effort to make it work.
Jeff Kell <[log in to unmask]>
|
|
|