home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / trl14db.zip / TRLPRG.EXE / DELAY.PRG < prev    next >
Text File  |  1990-10-22  |  1KB  |  44 lines

  1. ***********
  2. * DELAY.PRG
  3. * by Tom Rettig and Leonard Zerman
  4. * Placed in the Public Domain by Tom Rettig Associates, 10/22/1990.
  5. *
  6. * SYNTAX: DO DELAY WITH <seconds> 
  7. * RETURN: <expN> INKEY() keypress value used to exit
  8. * NOTE  : This routine is a timeout loop in number of
  9. *         seconds.  If the time out is more than 24 hours,
  10. *         the delay defaults to 24 hours with no override.
  11. ***********
  12. PARAMETERS waittime
  13. PRIVATE tr_temp,tr_temp2
  14.  
  15. * If waittime is greater than 24 hours.
  16. IF waittime > 86400
  17.    waittime = 86400
  18. ENDIF
  19.  
  20. * Convert current time to seconds.
  21. tr_temp = TIME()
  22. CALL trpass WITH tr_temp
  23. CALL trexe  WITH "TSTOS"
  24.  
  25. * Add waittime to current time and convert back to time string.
  26. waittime = waittime + tr_retn
  27. CALL trpass WITH waittime
  28. CALL trexe  WITH "TIMESTR"
  29.  
  30. * Delay loop.
  31. tr_temp  = 0
  32. CALL Trexe WITH "TRRETCLEN"
  33. tr_temp2 = SUBSTR(tr_retc,1,tr_retn)
  34. DO WHILE (TIME() # tr_temp2) .AND. (tr_temp = 0)
  35.    temp = INKEY()
  36. ENDDO
  37.  
  38. tr_retn = tr_temp   && return inkey value used to exit
  39. IF fox
  40.    RETURN (tr_retn)
  41. ENDIF
  42. * eof delay *
  43.  
  44.