Results 1 to 3 of 3

Thread: Need a lil help !!

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    brooklyn
    Posts
    2

    Red face Need a lil help !!

    Does anyone in there know anything about the timer? If so can you please give me some pointers. I really appreciate it.

  2. #2
    A timer in QBasic? Perhaps you meant to ask in the Visual Basic Forum...

  3. #3
    IWright
    Guest
    Help file for "Timer" in QBasic

    This covers pretty much everything about the timer... setting it up using timer on/off. Using the "On Timer(n%) Gosub line" you can execute a sub procedure if a certain time is reached.

    I can't remember how it exactly works because it's a long time since I played with it, but stick that example at the bottom into basic, play with the numbers, and you'll see what everything does in no time. Hope that helps.


    ------------------------------------------------------------------------------------
    TIMER enables, disables, or suspends timer event trapping.
    If event trapping is enabled, ON TIMER branches to a subroutine whenever
    a specified number of seconds has elapsed.

    TIMER ON
    TIMER OFF
    TIMER STOP
    ON TIMER(n%) GOSUB line

    þ TIMER ON Enables timer event trapping.
    þ TIMER OFF Disables timer event trapping.
    þ TIMER STOP Suspends timer event trapping. Events are processed
    once event trapping is enabled by TIMER ON.
    þ n% The number of seconds that elapse before ON TIMER
    branches to the event-trapping subroutine; a value in
    the range 1 through 86,400 (24 hours).
    þ line The label or number of the first line of the
    event-trapping subroutine.

    Example:
    ON TIMER(1) GOSUB TimeUpdate
    TIMER ON
    CLS
    PRINT "Time: "; TIME$
    StartTime = TIMER
    WHILE TimePast < 10
    TimePast = TIMER - StartTime
    WEND
    END

    TimeUpdate:
    LOCATE 1, 7: PRINT TIME$
    RETURN
    ------------------------------------------------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width