Microsoft KB Archive/58823

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Knowledge Base


SetDateTime ToolBox Example Correction on Page 520 "Reference"

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