Microsoft KB Archive/25989

= DATE$, TIME$ in Loop Can Push System Time Backwards in DOS 3.x =

Article ID: 25989

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 3.0
 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b

-



This article was previously published under Q25989



SUMMARY
The following Basic program makes the system time go backwards when run under MS-DOS Versions 3.x. FOR i = 1 TO 40 DATE$ = &quot;11/17/87&quot; PRINT TIME$ NEXT This behavior is caused by a DOS Versions 3.x problem, not a Basic problem. The problem does not occur in MS OS/2 real mode.

As a workaround, do not reset the date multiple times within a loop.

This information applies to Microsoft QuickBasic Versions 3.00, 4.00, 4.00b, and 4.50 and to Microsoft Basic Compiler Versions 6.00 and 6.00b when run under MS-DOS Versions 3.x.



MORE INFORMATION
For related information concerning Microsoft C, query on the following words:

_DOS_SETDATE and CLOCK and TIME and C

Additional query words: QuickBas BasicCom

Keywords: KB25989

-

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

© Microsoft Corporation. All rights reserved.