BUG: Multiple TIMER ON Resets ON TIMER GOSUB in QuickBasic (69043)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0a
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0b

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 "trap:" 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$=""
   TIMER ON             ' remove this line
WEND
END

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

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:kbbug KB69043