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%=&amp;HA03A
   SetDateTime%=&HA03A
   DO&amp;=NewDateTime&amp;
   DO&=NewDateTime&
   Toolbox &quot;R&quot;, SetDateTime%,rr&amp;(0),,,(DO&amp;)
   Toolbox &quot;R&quot;, 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&amp;(4)              '*** This line is corrected
<pre class="codesample">  DIM rr&(4)              '*** This line is corrected
   SetDateTime%=&amp;HA03A
   SetDateTime%=&HA03A
   DO&amp;=NewDateTime&amp;
   DO&=NewDateTime&
   Toolbox &quot;R&quot;, SetDateTime%,rr&amp;(0),,,(DO&amp;)
   Toolbox &quot;R&quot;, 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 &quot;I&quot;                          'Initialize toolbox and vars
<pre class="codesample">  Toolbox &quot;I&quot;                          'Initialize toolbox and vars
   DIM rr&amp;(4),OldDT&amp;,NewDT&amp;
   DIM rr&(4),OldDT&,NewDT&
   SetDateTime%=&amp;HA03A
   SetDateTime%=&HA03A


   GetDateTime OldDT&amp;                   'Get current info
   GetDateTime OldDT&                  'Get current info
   DO&amp;=OldDT&amp;+1000                      'Move forward 1000 seconds
   DO&=OldDT&+1000                      'Move forward 1000 seconds
   Toolbox &quot;R&quot;, SetDateTime%,rr&amp;(0),,,(DO&amp;)
   Toolbox &quot;R&quot;, SetDateTime%,rr&(0),,,(DO&)


   GetDateTime NewDT&amp;                   'Get new info
   GetDateTime NewDT&                  'Get new info
   DO&amp;=NewDT&amp;-1000                      'Reset date and time
   DO&=NewDT&-1000                      'Reset date and time
   Toolbox &quot;R&quot;, SetDateTime%,rr&amp;(0),,,(DO&amp;)
   Toolbox &quot;R&quot;, SetDateTime%,rr&(0),,,(DO&)


   PRINT OldDT&amp;, NewDT&amp;                 'Show difference
   PRINT OldDT&, NewDT&                'Show difference
                 </pre>
                 </pre>



Latest revision as of 14:14, 21 July 2020

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