Microsoft KB Archive/58823: Difference between revisions
From BetaArchive Wiki
(importing KB archive) |
m (Text replacement - "&" to "&") |
||
Line 44: | Line 44: | ||
The incorrect example from Page 520 is as follows: | The incorrect example from Page 520 is as follows: | ||
<pre class="codesample"> DIMrr$(4) | <pre class="codesample"> DIMrr$(4) | ||
SetDateTime%=& | SetDateTime%=&HA03A | ||
DO& | DO&=NewDateTime& | ||
Toolbox "R", SetDateTime%,rr& | Toolbox "R", SetDateTime%,rr&(0),,,(DO&) | ||
</pre> | </pre> | ||
It should be changed to read as follows: | It should be changed to read as follows: | ||
<pre class="codesample"> DIM rr& | <pre class="codesample"> DIM rr&(4) '*** This line is corrected | ||
SetDateTime%=& | SetDateTime%=&HA03A | ||
DO& | DO&=NewDateTime& | ||
Toolbox "R", SetDateTime%,rr& | Toolbox "R", SetDateTime%,rr&(0),,,(DO&) | ||
</pre> | </pre> | ||
The following is a full example of using SetDateTime: | The following is a full example of using SetDateTime: | ||
<pre class="codesample"> Toolbox "I" 'Initialize toolbox and vars | <pre class="codesample"> Toolbox "I" 'Initialize toolbox and vars | ||
DIM rr& | DIM rr&(4),OldDT&,NewDT& | ||
SetDateTime%=& | SetDateTime%=&HA03A | ||
GetDateTime OldDT& | GetDateTime OldDT& 'Get current info | ||
DO& | DO&=OldDT&+1000 'Move forward 1000 seconds | ||
Toolbox "R", SetDateTime%,rr& | Toolbox "R", SetDateTime%,rr&(0),,,(DO&) | ||
GetDateTime NewDT& | GetDateTime NewDT& 'Get new info | ||
DO& | DO&=NewDT&-1000 'Reset date and time | ||
Toolbox "R", SetDateTime%,rr& | Toolbox "R", SetDateTime%,rr&(0),,,(DO&) | ||
PRINT OldDT& | PRINT OldDT&, NewDT& 'Show difference | ||
</pre> | </pre> | ||
Latest revision as of 14:14, 21 July 2020
Article ID: 58823
Article Last Modified on 11/21/2006
This article was previously published under Q58823
SUMMARY
The SetDateTime Example on Page 520 of the "Microsoft QuickBASIC for Apple Macintosh: Language Reference" is incorrect. The DIM statement is missing a space and uses the wrong type for the array.
This information applies to Microsoft QuickBASIC Version 1.00 for the Apple Macintosh.
MORE INFORMATION
The incorrect example from Page 520 is as follows:
DIMrr$(4) SetDateTime%=&HA03A DO&=NewDateTime& Toolbox "R", SetDateTime%,rr&(0),,,(DO&)
It should be changed to read as follows:
DIM rr&(4) '*** This line is corrected SetDateTime%=&HA03A DO&=NewDateTime& Toolbox "R", SetDateTime%,rr&(0),,,(DO&)
The following is a full example of using SetDateTime:
Toolbox "I" 'Initialize toolbox and vars DIM rr&(4),OldDT&,NewDT& SetDateTime%=&HA03A GetDateTime OldDT& 'Get current info DO&=OldDT&+1000 'Move forward 1000 seconds Toolbox "R", SetDateTime%,rr&(0),,,(DO&) GetDateTime NewDT& 'Get new info DO&=NewDT&-1000 'Reset date and time Toolbox "R", SetDateTime%,rr&(0),,,(DO&) PRINT OldDT&, NewDT& 'Show difference
Additional query words: MQuickB
Keywords: KB58823