TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jerry McBride
from: Bill Parker
date: 1995-02-09 09:06:16
subject: Rexx - Inkey$ ?

BP> Thanks, Phil...but you do this with SysGetKey. Someone here
 BP> claimed they were able to make CHARIN() operate like Inkey$
 BP> and that is the example I would like to see because CHARIN()
 BP> doesn't appear to work that way on my system. 

 JM> I haven't been able to implement an inkey$ function in 
 JM> rexx. I've tried charin() and sysgetkey(), but each expects
 JM> to see the enter key pressed before it'll return to the progam.

SysGetKey() should not be waiting for the ENTER key. The REXX reference
manual says "Unlike the REXX CHARIN built-in function, SysGetKey()
does not wait until the Enter key is pressed."

The following seems to work properly on my system...you might want to give
it a try and let me know what happens.

/* sit in a loop waiting for a key to be pressed */

call RxFuncAdd 'SysGetKey', 'RexxUtil', 'SysGetKey'
i = 0
do while key  'Q' & key  'q'
  i = i + 1
  key = InKey()
  if key  '' then say "at iteration" i "key pressed
was" key
end
call RxFuncDrop 'SysGetKey'
exit

InKey: procedure
if CHARS() = 0 then return ''
return SysGetKey('NOECHO')

Bill

--- Maximus/2 2.01wb
* Origin: Blue Bird Of Prey * Vergennes, VT * (802) 877-6912 (1:325/207)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 955 712/515 713/888 800/1 7877/2809
@PATH: 325/207 118 320/209 142/1 3615/50 229/2 12/2442 711/409 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.