TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: John Poltorak
from: hugo landsman
date: 1995-02-27 19:10:02
subject: Rexx - Inkey$ ?

hi John,

 BS>> It _seriously_ annoys me  that IBM chose to make syssleep() with a
 BS>> resolution of one second, given that the DosSleep() api can resolve
 BS>> done to a millisecond-you can recompile the syssleep() example code
 BS>> in the OS2 toolkit to get a syssleep() with a finer granularity(
 BS>> tenths and hundreths are more useful for me).

 JP> My solution to the keypress problem would be to use an inkey()

What problem?  CHARS() and SysGetKey() do the job.

 JP> function as provided with the Quercus Systems REXX library functions,
 JP> which incidentally, also offers a delay() function - accurate to one
 JP> tenth of a second.

This one is freeware:


/* SLEEP.CMD : Rexx/2 with RexxIPC.DLL */
parse arg delay
if 0=DataType(delay,"W") then do
  say "Usage: SLEEP "
  say "where 'delay' is the number of milliseconds you want to sleep"
  say "SLEEP returns the number of milliseconds slept."
  return -1
end
call RxFuncAdd "SemLoadFuncs", "RexxIPC",
"SemLoadFuncs"
call SemLoadFuncs
call SemEventCreate "sem"
rval = Time("E")
call SemEventWait sem, delay
rval = 1000*(Time("E")-rval)
call SemEventClose sem
return rval


I could have used YdbaUtil instead with narry a change...

regards,
         hugo

* Origin: St. Anna Station (2:283/608.5)
SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 942
SEEN-BY: 711/955 712/407 515 628 704 713/888 800/1 7877/2809
@PATH: 283/608 6 1 512 280/801 24/24 396/1 3615/50 105/103 42 712/515 711/808
@PATH: 711/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™.