The
get time$() command is seemingly useless all alone. However, if manipulated, it can be very useful. This snippet converts the string to a manipulatable value, standard time. An example line of code is included, showing a method of displaying the time, in a formatted matter, on-screen. Place these codes in a loop, and you have current time.
Converter:
REM << record current time into a string
time$ = get time$()
REM << seperate string into three values(hour,mins,secs)leaving out colons
count = 5
for t = 1 to 3
REM << get both digits
time(t) = val(left$(time$,2))
REM << delete used digits and next colon
if t < 3 then time$ = right$(time$,count)
dec count,3
next t
REM << create standard time, by converting the hour
if time(1) => 13
time(1) = time(1) - 12
symbol$ = "pm"
else
symbol$ = "am"
endif
Formatter:
text 0,0,str$(time(1)) + ":" + str$(time(2)) + ":" + str$(time(3)) + symbol$
+NanoBrain+