HP3000-L Archives

December 1996, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Kell <[log in to unmask]>
Reply To:
Jeff Kell <[log in to unmask]>
Date:
Wed, 11 Dec 1996 19:58:18 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
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]>

ATOM RSS1 RSS2