comp.lang.ada
 help / color / mirror / Atom feed
* Re: Readkey in VAX Ada 83
@ 1995-02-01 14:11 CONDIC
  0 siblings, 0 replies; 4+ messages in thread
From: CONDIC @ 1995-02-01 14:11 UTC (permalink / raw)


From: Marin David Condic, 407.796.8997, M/S 731-93
Subject: Re: Readkey in VAX Ada 83
Original_To:  PROFS%"SMTP@PWAGPDB"
Original_cc:  CONDIC



>
>I posted earlier about getting a character from the keyboard buffer but left
>out a vital part... I'm using VAX Ada... I've had a few responses and one
>person mentioned the file STARLET.... does anyone know if the answer lies in
>here because the file is 2500 blocks long ... thanks.. e-mail me with response
>
I believe that the relavent STARLET call looks like this:

    STARLET.QIOW(
         STATUS => STATUS,
         EFN    => INPUT_EFN,
         CHAN   => INPUT_CHANNEL,
         FUNC   => STARLET.IO_READVBLK,
         P1     => SYSTEM.TO_UNSIGNED_LONGWORD(KEY'address),
         P2     => 2);

However, this is not the only answer for reading characters
from the keyboard as they occur.

STARLET is just one of the packages VAX Ada provides to give you
the connections you want to system services. If you know how to
get keystrokes through any variety of system calls, somewhere in
the ACS Ada library you will find an interface to the system
call.

You will also want to investigate the SMG$ routines and I believe
that there is a call known as SMG$READ_KEYSTROKE. (Try ACS
EXTRACT SOURCE/SPECIFICATION_ONLY SMG to see the package spec for
all the SMG calls.)

Of course, the truly studly way of getting keystrokes is through
the use of Asynchronous System Traps - you have to set up a
mailbox and tie an AST to a task entry and all sorts of other
delecate operations which will take you right down into the
bowels of VMS. (Details left as an exercise for the student. It's
not pretty!) This will allow you to react to keystrokes as
independent events - but beware: it can be slow and is subject to
application lockup due to buffer overflows.

And then we could always ask the question: "When will compiler
writers give me a TEXT_IO.GET_CHARACTER routine which behaves the
way I want it to when connected to a keyboard?" But that might
take all the glamour our of application programming ;-)

Pax,
Marin

Marin David Condic, Senior Computer Engineer    ATT:        407.796.8997
M/S 731-93                                      Technet:    796.8997
Pratt & Whitney, GESP                           Internet:   CONDICMA@PWFL.COM
P.O. Box 109600                                 Internet:   MDCONDIC@AOL.COM
West Palm Beach, FL 33410-9600
===============================================================================
    "I have traveled the length and breadth of this country and talked
    with the best people, and I can assure you that data processing is
    a fad that won't last out the year."

        --  The editor in charge of business books for Prentice
            Hall, 1957.
===============================================================================



^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <1995Jan27.172515.1@clstcs>]

end of thread, other threads:[~1995-02-02 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-02-01 14:11 Readkey in VAX Ada 83 CONDIC
     [not found] <1995Jan27.172515.1@clstcs>
1995-01-31 13:38 ` Theodore E. Dennison
1995-01-31 21:03 ` Larry Kahn
1995-02-02 13:28 ` Larry Kilgallen, LJK Software

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox