ex.hlp (Topic list)
TIME$ Function and TIME$ Statement Example
                        Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
' This example uses the TIME$ function to display the computer's current
' system time. The TIME$ statement is then used to reset the system's time
' based on user input.
 
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the code example below to the code window
' 3. Press F5 to run the example
 
 DO UNTIL answer$ = "y"
     CLS                         ' Clear the screen
     PRINT "The current time is: " + TIME$
     PRINT
     DO
          INPUT "Enter the hour: ", hour$
     LOOP UNTIL (VAL(hour$) < 24 AND VAL(hour$) >= 0)
     DO
          INPUT "Enter minutes: ", minutes$
     LOOP UNTIL (VAL(minutes$) < 60 AND VAL(minutes$) >= 0)
     DO
          INPUT "Enter seconds: ", seconds$
     LOOP UNTIL (VAL(seconds$) < 60 AND VAL(seconds$) >= 0)
     TIME$ = hour$ + ":" + minutes$ + ":" + seconds$
     LOCATE 10, 1
     PRINT "The new time is: " + TIME$
     INPUT "Is this ok (y/n)? ", answer$
 LOOP