Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- QuickBASIC 3.0 - <b>on timer trap for elapsed time</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ON TIMER                 Trap for Elapsed Time

 ON TIMER(n) GOSUB {linenum | linelabel}

    Establishes a subroutine to which QuickBASIC will branch if a
    specified number of seconds have passed. The trap must also be turned
    on by means of a TIMER ON statement.

           n    A numeric expression in the range 1 to 86,400 (1 second to
                24 hours).

     linenum    The first line of a timer-handling subroutine. Setting
                linenum to 0 disables trapping.

   linelabel    A label identifying the first line of a timer-handling
                routine.

   -----------------------------------------------------------------------

      Notes:    {linenum | linelabel} must be defined at the main program
                level.

                With trapping in effect, QuickBASIC checks to see if the
                specified number of seconds have elapsed. When the
                specified amount of time has passed, QuickBASIC branches
                to the specified subroutine and temporarily suspends
                trapping (by means of an implicit TIMER STOP statement).
                Trapping automatically resumes when a RETURN from the
                handling subroutine is executed (unless the handler
                explicitly performs a TIMER OFF or TIMER STOP).

                All event trapping is temporarily disabled when QuickBASIC
                is executing an error-handling routine (established via an
                ON ERROR statement).

                If the "Checking Between Statements" option is in effect,
                QB checks after each statement. If the "Event Trapping"
                option is selected, QB checks after each new program line.
                If neither option is selected, no trapping takes place.

                For command-line compilation, /v enables checking after
                each statement, and /w enables checking after each new
                line. If neither switch is used, no trapping takes place.

See Also: TIMER (Statement)

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson