PRB: Output from TIME() Does Not Change with SET HOURSID: Q127179 3.00 WINDOWS
The information in this article applies to:
SYMPTOMSIf TIME() is supplied as the initial value of a text box, The SET HOURS TO command has no effect on the time value displayed.
CAUSETIME() returns a character string in the 24-hour HH:MM:SS format regardless of the SET HOURS setting. As a result, the text box control is not a time value but a character value and will behave as such.
WORKAROUNDAdd a new method to the form to perform the necessary conversion regardless of whether the SET HOURS TO value is determined by the current environment settings or changed programmatically at run-time.
Step-by-Step ExampleSteps 1 through 5 in the following procedure illustrate how to change the hours setting in a program by adding two option buttons. You can omit steps 2 through 5 if desired. 1. Open the desired form or create a new one named Form1. 2. Choose the Form Control toolbar from the View menu. 3. Pick the Option Group tool, and put a set of Option Buttons on the form. 4. Double-click the Option Buttons to open the OptionsGroup1 code dialog.
5. Select Option1 under the Object list box. Then select Click from the 6. If a new form was created in step 1, add a Text box (Text1) to the form,
7. While Form Designer is selected, choose the Form menu pad from the
8. In the Description box, enter the following and click OK to save the new
9. Choose Properties under the system menu View pad or click Form1 with the
10. While Form1 is shown as the current object, choose the Method tab.
11. Double-click the civtym procedure at the end of the Method list, and 12. From the same dialog, select the Init procedure, and enter this code:
13. Type SET HOURS TO 12 in the Command window.
14. Run the form, and note the display. If option buttons are used, note
STATUSThis behavior is by design. Additional reference words: VFoxWin 3.00 KBSubcategory: FxprgSet
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |