comp.lang.ada
 help / color / mirror / Atom feed
From: CONDIC@PSAVAX.PWFL.COM
Subject: Re: HELP
Date: Wed, 19 Oct 1994 12:26:17 EDT
Date: 1994-10-19T12:26:17-04:00	[thread overview]
Message-ID: <9410191629.AA21032@ajpo.sei.cmu.edu> (raw)

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



>dewar@cs.nyu.edu (Robert Dewar) writes:
>
>>Time for another reminder. It is useless to ask questions about features
>>like this that are implementation dependent unless you tell us what
>>compiler you are using, what version, what operating system, what
>>machine etc.
>
>I am using DEC ada and I think it is Ada 83 compiler.
>
I believe that the original question was how to read a single
character input from the keyboard. Given that you're using DEC
Ada83, I can tell you how we have dealt with it. One method is to
rely on the DEC OS calls in the SMG library. (This involves more
than a simple call, since you first have to set up a sort of
pseudo-windowing environment that tries to make a VT terminal
behave more like Motif!) Anyway, the relavent call can be
interfaced with as follows:

===============================================================================
=

-------------------------------------------------------------------------------
    --  Read a Single Character
    --
    --  SMG$READ_KEYSTROKE status, keyboard_id, word_terminator_code
    --          [,prompt_string] [,timeout] [,display_id], [,rendition_set]
    --          [,rendition_compliment]
    --
    --  status          = Return status of call
    --  keyboard_id     = id of the virtual keyboard you are reading from
    --  prompt_string   = string used for prompt
    --  timeout         = if specified, any character typed before time_out
    --                    is returned in the buffer
    --  display_id      = id of the virtural display
    --  rendition_set   = video attributes for text
    --  rendition_compliment    = video attributes for text
    --

-------------------------------------------------------------------------------

    procedure SMG_READ_KEYSTROKE (
        STATUS                  : out CONDITION_HANDLING.COND_VALUE_TYPE;
        KEYBOARD_ID             : in KEYBOARD_TYPE;
        WORD_TERMINATOR_CODE    : out UNSIGNED_WORD;
        PROMPT_STRING           : in STRING := STRING'NULL_PARAMETER;
        TIMEOUT                 : in INTEGER := INTEGER'NULL_PARAMETER;
        DISPLAY_ID              : in DISPLAY_TYPE :=
DISPLAY_TYPE'NULL_PARAMETER;
        RENDITION_SET           : in SYSTEM.UNSIGNED_LONGWORD :=
SYSTEM.UNSIGNED_LONGWORD'NULL_PARAMETER;
        RENDITION_COMPLIMENT    : in SYSTEM.UNSIGNED_LONGWORD :=
SYSTEM.UNSIGNED_LONGWORD'NULL_PARAMETER

    pragma INTERFACE (VAXRTL, SMG_READ_KEYSTROKE);
    pragma IMPORT_VALUED_PROCEDURE (
        INTERNAL => SMG_READ_KEYSTROKE,
        EXTERNAL => "SMG$READ_KEYSTROKE",
        PARAMETER_TYPES => (COND_VALUE_TYPE, UNSIGNED_LONGWORD,
                            UNSIGNED_WORD, STRING, INTEGER,
                            UNSIGNED_LONGWORD, UNSIGNED_LONGWORD,
                            UNSIGNED_LONGWORD),
        MECHANISM => (VALUE, REFERENCE, REFERENCE, DESCRIPTOR,
                      REFERENCE, REFERENCE, REFERENCE, REFERENCE));

===============================================================================

I believe this call is duplicated in a package DEC provides
called "SMG" (appropriately enough!) Do an ACS command as follows

ACS> EXTRACT SOURCE/SPEC SMG

An alternate technique which only works moderately well, but does
provide for asynchronous keyboard/terminal behavior is to connect
an asynchronous system trap (AST) to a task entry and tie the AST
to the appropriate low level QIO routines. We've done this around
here and found that it can't always respond fast enough - but
it's still useful. How to do this is sufficiently complex that
I'd probably never give you a satisfying answer herin. Check the
VAX/VMS manuals on AST's and QIO's to understand how they work,
then check the DEC Ada manual to see how to connect an AST to a
task entry.

Pax Vobiscum,
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
===============================================================================
    Glendower: "I can call spirits from the vasty deep."
    Hotspur: "Why so can I, or so can any man; but will they come when
    you do call for them?"

        -- Shakespeare, "Henry IV"
===============================================================================



             reply	other threads:[~1994-10-19 16:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-19 16:26 CONDIC [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-09-19 19:51 help mop
2001-09-20  8:41 ` help John McCabe
1998-12-07  0:00 help Salvador
1998-12-07  0:00 ` help dennison
1997-02-27  0:00 Help Desperate
1997-03-04  0:00 ` Help Jim Dorman
1996-11-15  0:00 Help Alexander B. Schmidt
1996-11-15  0:00 ` Help Michael Paus
1996-11-18  0:00 ` Help Norman H. Cohen
1996-11-19  0:00 ` Help Matthew Heaney
1994-10-14  3:33 HELP Chiu Bo (Hung Chiu Hung)
1994-10-14 13:21 ` HELP Robert Dewar
1994-10-15 14:56   ` HELP Bob Duff
1994-10-18 16:31     ` HELP Robert Dewar
1994-10-16  5:11   ` HELP Chiu Bo (Hung Chiu Hung)
1994-10-14 19:36 ` HELP riehler
1994-10-14 19:36 ` HELP Richard Riehle
1994-10-19  3:10 ` HELP Michael M. Bishop
1993-03-12 22:28 Help Basavaraj B Patil
1990-08-01 18:19 Help Kenneth Anderson
replies disabled

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