#18 Accepting user input without carriage return?

closed
None
5
2003-04-25
2003-04-09
Anonymous
No

Hi,

In my "more" replacement program implemented in Rexx,
I'd love to act on user commands based on a single
keystroke (e.g., pressing "f" or "b" moves forward or
backward one screen, respectively). I'm unable to
figure out how to do this and as a consequence all user
commands must be terminated by a carriage return
(<CR>). I tried the following:
l=charout(stdout,"Enter a command: "
userinput = charin(stdin,,1)

but its behavior is not as I expected: it still
requires <CR>, and it then reads both the command and
<CR> as separate entities.

Variations on the charin statement do not seem to help.
Any thoughts?

Thanks,
Chris
cniggeler@yahoo.com

Discussion

  • Mark Hessling

    Mark Hessling - 2003-04-25
    • assigned_to: nobody --> rexx
    • status: open --> closed
     
  • Mark Hessling

    Mark Hessling - 2003-04-25

    Logged In: YES
    user_id=86185

    If you need this behaviour then I'd suggest you use RegUtil.
    It has a sysgetkey() (I think that's the function) function
    which is specifically designed for this purpose. RegUtil is
    available at:
    http://home.interlog.com/~ptjm/software.html

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks