scripting@wanadoo.nl




Wait()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
25 March 2002 Wait()
AuthorScriptLogic Corporation
Action Pauses script execution for a specified number of seconds or until a key is pressed.
SyntaxWait (seconds) 
Parameters
  • seconds (Required / Numeric) the number of seconds to wait. 
  • RemarksSimilar to KiXtart's native Sleep command, but give you the ability to break out of the sleep cycle if a key is pressed.
    The codes returned by this function have changed on 17-Nov-2001. Please update you library. 
    Returns0 = Wait cycle completed without interruption.
    x = Number of seconds elapsed at the time a key was pressed. 
    Examples
    ?'Press any key within the next 10 seconds to abort script...'
    $rc=Wait(10)
    IF ($rc <> 0)
      ?'Script terminating!'
      QUIT
    ENDIF
    ?'Script continuing...'
    
     
    Source
    FUNCTION Wait ($seconds)
      ; similar to KiXtart's built-in SLEEP command, but this UDF can wake up
      ; early if a key is pressed during the sleep cycle.
      ;
      ; Returns null string if sleep cycle completed without interruption.
      ; Returns string of key pressed, if a key was pressed during wait cycle.
    
      DIM $x
      $wait=''
      IF ($seconds > 0)
        FOR $x=1 TO $seconds
          SLEEP 1
          $wait=KbHit()
          IF $wait
            RETURN
          ENDIF
        NEXT
      ENDIF
    ENDFUNCTION ; - Wait -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter