Microsoft KB Archive/69043

= BUG: Multiple TIMER ON Resets ON TIMER GOSUB in QuickBasic =

Article ID: 69043

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0
 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q69043



SYMPTOMS
Whenever a TIMER ON statement executes in QuickBasic for Macintosh, the ON TIMER GOSUB timer is reset. When TIMER ON executes multiple times, this may cause the event trap to never execute, or execute slower than expected. The following program demonstrates this behavior.

Microsoft has confirmed this to be a bug with Microsoft QuickBasic 1.00, 1.00a, and 1.00b for the Macintosh. We are researching this problem and will post new information here as it becomes available.

(This problem does not occur with QuickBasic for MS-DOS.)



MORE INFORMATION
To work around the problem, execute the TIMER ON statement once during the time when you want to have the ON TIMER GOSUB active.

The following program should jump to &quot;trap:&quot; once every second; however, because the TIMER ON statement is executed faster than once per second, the event trap never takes place. To make the program perform as expected, remove the TIMER ON statement in the WHILE... WEND loop.

Code Sample
ON TIMER(1) GOSUB trap TIMER ON

WHILE INKEY$=&quot;&quot; TIMER ON            ' remove this line WEND END

trap: i=i+1 LOCATE 1,1 PRINT i  RETURN

Additional query words: MQuickB

Keywords: kbbug KB69043

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.