• 2200 UCS C Question

    From Kira Ash@21:1/5 to All on Thu Sep 8 09:44:02 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew@21:1/5 to Kira Ash on Thu Sep 8 20:49:25 2022
    Kira Ash wrote:
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kira Ash@21:1/5 to Andrew on Thu Sep 8 12:23:25 2022
    On Thursday, September 8, 2022 at 11:49:32 AM UTC-7, Andrew wrote:
    Kira Ash wrote:
    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.

    Thank you so much! That explains it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)