* VMS Pascal Terminal I/O help needed
@ 1987-02-27 21:35 denbeste
1987-03-01 7:49 ` perry
0 siblings, 1 reply; 2+ messages in thread
From: denbeste @ 1987-02-27 21:35 UTC (permalink / raw)
I am having difficulties writing what should be a simple program. I want to
read in a character at a time from the keyboard and print out the next higher
character. I also want a prompt to be displayed. My initial expectation was
to write the program as follows
PROGRAM NextChar(Input,Output);
VAR
ch : Char;
BEGIN
WriteLn('Press RETURN to Exit');
Write('prompt>');
REPEAT
Read(CH);
Write(chr(ord(ch)+1));
UNTIL ch = chr(13);
WriteLn(' Thank You.');
END.
My problem with this is that Read doesn't pass on the char until return has
been pressed on the keyboard.
One sugestion was to use the SMG$ routines and create a virtual keyboard.
This worked, except that it created another problem. None of my output,
including the prompt, was echoed until the WriteLn was encountered. (It is
also a royal pain for such a simple task.)
Please excuse any typos in the example, as I had to retype it in on our UNIX
vax for posting.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Wiliam C. DenBesten | ... !osu-eddie!bgsuvax!denbeste UUCP
Dept of Computer Science | denbeste%research1.bgsu.edu@csnet-relay ARPA
Bowling Green State University | denbeste@research1.bgsu.edu CSNET
Bowling Green, OH 43403-0214 | #include <std.disclaimer.h>
--------------------------------+----------------------------------------------
There is no difference between theory and practice in theory, but there is
often a great deal of difference between theory and practice in practice.
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: VMS Pascal Terminal I/O help needed
1987-02-27 21:35 VMS Pascal Terminal I/O help needed denbeste
@ 1987-03-01 7:49 ` perry
0 siblings, 0 replies; 2+ messages in thread
From: perry @ 1987-03-01 7:49 UTC (permalink / raw)
In article <701@bgsuvax.UUCP> denbeste@bgsuvax.UUCP (William C. DenBesten) writes:
>I am having difficulties writing what should be a simple program. I want to
>read in a character at a time from the keyboard ...
Here is a sample program doing single character input from VAX/VMS Pascal,
see $help system and look at sys$library:starlet.pas for more info on the
wierd $assign and $qiow bs. Unfortunately, I don't think there is any way
to get the io$ symbols directly into Pascal, I copied the values from
one of the FORSYSDEF modules...
...Rick ..{cbmvax,pyrnj,bpa}!vu-vlsi!perry
perry@vuvaxcom.bitnet
---
[inherit('sys$library:starlet')]
program ascii(output);
var c:char; chan: [word] 0..65535;
code: integer := %x'3A' + %x'40'; { io$_ttyreadall + io$m_noecho }
begin
$assign('tt',chan);
open(output,'tt:'); rewrite(output);
writeln('Enter Q or q to quit.');
writeln('Start entering characters...');
repeat
$qiow(,chan,code,,,,c,1);
writeln('Character=',c,' ASCII code = ',ord(c):1)
until (c='Q') or (c='q')
end.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1987-03-01 7:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1987-02-27 21:35 VMS Pascal Terminal I/O help needed denbeste
1987-03-01 7:49 ` perry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox