comp.lang.ada
 help / color / mirror / Atom feed
From: sercely@convex.com (Ron Sercely)
Subject: Re: How do I "Get" just 4 characters?
Date: Fri, 5 Mar 1993 15:55:45 GMT
Date: 1993-03-05T15:55:45+00:00	[thread overview]
Message-ID: <1993Mar5.155545.3071@convex.com> (raw)
In-Reply-To: C3EInI.5KE@news.cso.uiuc.edu

Sorry for the cryptic post.  Most of my message was (due to my error) ommited.
I do my development on Convex Ada, which is derived from Verdix Ada.  On most
Verdix systems, I/O requests eventually map to C library calls.  The default
model used for reads on must Unix system uses line buffering, (so that the
delete key works, for example).  The way that line buffering is disable is to
set the stty mode to cbreak.  This package uses commonly supplied Verdix
packages to allow a program to set STANDAND_INPUT to cbreak mode, which
solves the problem of the orignial post. 

with Text_IO;
with set_tty_modes;

procedure test is

   subtype pin_type is string(1..4);
   A   : pin_type;
   Num : INTEGER;

begin
   set_tty_modes.set_cbreak;  -- inserted line
   Text_IO.Get(A);
   Text_Io.New_Line;  -- necessary to duplicate the output desired
                      -- by the original poster
   Text_IO.PUT_LINE(A);
   set_tty_modes.unset_cbreak;  -- inserted line
end test;


Hope the post makes sense this time :-)

Ron Sercely




  reply	other threads:[~1993-03-05 15:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-04 19:22 How do I "Get" just 4 characters? Kenneth Anderson
1993-03-04 22:18 ` Dat Trieu Le
1993-03-04 23:20   ` Ron Sercely
1993-03-05  5:45     ` Dat Trieu Le
1993-03-05 15:55       ` Ron Sercely [this message]
1993-03-05  5:56 ` Craig Manahan
replies disabled

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