HP3000-L Archives

March 1998, 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:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Fri, 13 Mar 1998 11:16:44 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
Jacek,

> How can I get in Cobol number of key, for example number of cursor keys,
> Prev, Next, Scrool down, up ........
> I don't want use function keys to scrool data on the screen but cursor keys.
> How can I do it?


It's a two-part process:

  1) You have to tell the terminal that you want it to transmit
     something to the computer when a cursor key is pressed.
     (By default, the cursor/page/home/down keys don't transmit
     anything.)

     Note: when you've done this, those keys transmit *TWO*
     characters: an escape (decimal 27), and a letter.
     (E.g., up-arrow transmits ESCAPE "A";
     down-arrow transmits ESCAPE "B")

     The way to tell the terminal to transmit those special
     keys is to send a 5 character escape sequence:

        ESCAPE "&s1A"    (that's five characters,total...
                          don't send the quotes or blanks)
                         (that's a one after the "s", not
                          the letter ell)

     You can turn off this feature by sending:

        ESCAPE "&s0A"    (that's five characters,total...

  2) You have to be able to handle the incoming data from the
     terminal.

     This is significantly harder.

     Normally, most programs read a line of text from the terminal...
     this means that the cursor keys would simply send their two
     characters and they'd be buffered up (and not get to the program)
     until a <return> is pressed.  This may be acceptable for your
     application ... it's worked well for some people.

     If, however, you want to have the program instantly respond to
     the cursor keys (by doing something ... remember, the *terminal*
     has already moved the cursor appropriately), then that's where
     things get difficult.  You'd have to have either entered the
     world of single-character reads (*with* type-ahead enabled),
     or get into more esoteric solutions (as has been done with
     FSEDIT from Sydes ... they use line input part of the time,
     and 1 or 2 character reads part of the time)

Other options include using a TypeAhead Engine ([log in to unmask],
or www.telamon.com), or DTC Field Mode (requires a DTC-connected
terminal, a modern DTC, and luck), and block mode.

Block mode may be your best bet ... it's a completely different
way of interacting with the terminal.  You display a screen,
the user moves the cursor at will, perhaps entering data, and eventually
presses <enter> (not <return>, unless you get fancy and
redefine <return> as <enter> for those terminals that
support this).

If you choose to use block mode, there's a number of solutions:
roll-your-own, V/Plus, JaiAlai (sp? a layer on top of V/Plus),
and third party products.

Another alternative that may appeal to you is to use a third
party windowing package (the first on the market was Wingspan,
from Denkart, but others exist).    (No, I have no financial
interest in Wingspan.)

--
Stan Sieler                                          [log in to unmask]
                                     http://www.allegro.com/sieler.html

ATOM RSS1 RSS2