Hi all,
I'm fairly new to the OS 2200 environment. I noticed that when I invoke newly compiled UCS C programs with @XQT, access to stdin works as expected - the user is prompted for input by getchar(), for instance. However, when invoking the program directly (via @programname), the program immediately completes without prompting for input, and garbage is present in the input buffers. I'm probably missing something obvious, but I would very much appreciate any suggestions as to why this is!!
Kira
Kira Ash wrote:Thank you so much! That explains it.
Hi all,
I'm fairly new to the OS 2200 environment. I noticed that when I invoke newly compiled UCS C programs with @XQT, access to stdin works as expected - the user is prompted for input by getchar(), for instance. However, when invoking the program directly (via @programname), the program immediately completes without prompting for input, and garbage is present in the input buffers. I'm probably missing something obvious, but I would very much appreciate any suggestions as to why this is!!
Kira
If you call a program as a processor, the first thing you get to read is
the fields on the processor call. As an example,
@UC,opts file.input-elt,file2.output-om
The normal procedure is to call RINF$ (SYSLIB) to move all this
information to an internal buffer, RINF$ uses some form of ER READ$ or
ER SYMB$ to do this. Once you have read the command line you can start
using getchar() normally.
If you call a program using @xqt you don't have anything RINF$
understands so you can move straight to user-input.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 63 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 492925:58:50 |
| Calls: | 840 |
| Calls today: | 1 |
| Files: | 1,300 |
| D/L today: |
5 files (16,259K bytes) |
| Messages: | 258,426 |