Deutsch English
Alphabetical index
Array functions
CGI functions
Data types
Date functions
Debugging
Fulltext functions
Language elements
Numerical functions
Operators
Other functions
Ramtext functions
Selecting
Socket functions
Statistical functions
Stream functions
String functions
System functions
  • chdir()
  • chmod()
  • compile()
  • copyfile()
  • delfile()
  • delident()
  • dirinfo()
  • diskfree()
  • DO
  • execprog()
  • firstdir()
  • flush()
  • getdir()
  • getenv()
  • getident()
  • getpara()
  • getsize()
  • halt()
  • isfile()
  • makedir()
  • nextdir()
  • pause()
  • privdir()
  • remdir()
  • rename()
  • setcgilog()
  • setident()
  • setpara()
  • testident()
  • timeout()
  • today()
  • varname()
    Table functions
    Text functions
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex System functions
    Function timeout()
    Short (Linux only) Quits execution of a procedure after a timeout passed
    Syntax Timeout(seconds : INTEGER) : INTEGER
    Parameter seconds : Number of seconds until execution abort or 0 to cancel a previously set timeout
    Return
    See also:
    Description This function calls the linux function Alarm and passes the given parameter to it.
    The linux kernel then sends a SIGALRM signal to the process calling after a given number of seconds have passed.
    Tdbengine processes this signal by immediately leaving the currently processed procedure by executing RETURN 0 (or RETURN "" for STRING functions).
    In case that, before the signal was sent, the function Timeout() has been called with the parameter 0, no signal will be send at all.
    This allows a easy but effective way to code timeouts.

    Example 1: Timeout + ReadLn from console

    The user has 10 seconds to enter his account ID.

    PROCEDURE Input : INTEGER
    VAR id : STRING
      Timeout(10)
      writeln(0,'Your account id: ')
      id:=readln(0)
      TimeOut(0)
      RETURN 1
    ENDPROC
    
    PROCEDURE Main
      cgiclosebuffer
      IF Input THEN
        writeln(0,'Your input will be processed now...')
      ELSE
        writeln(0,'Cancel forced by timeout')
      END
    ENDPROC
    


    User comments:
    Write a comment:
    Name
    EMail
    Subject
    Text (Switch mode)

    Choose between
    the normal and the
    advanced editor.
    The advanced editor
    runs in IE 5+ and
    Mozilla 1.4+ only
    SPAM-Protection Please enter tdbengine in this field.

    tdbengine chat
    irc.tdbengine.org
    #tdbengine

       Copyright © 2003-2004 tdb Software Service GmbH
       Alle rechte vorbehalten. / All rights reserved
       Last changed: 21.10.2004
    {Fehler für :execmacro{execmacro="sessionspy"}