|
|
DataMuseum.dkPresents historical artifacts from the history of: RegneCentralen RC759 "Piccoline" |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RegneCentralen RC759 "Piccoline" Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1922 (0x782)
Types: TextFile
Names: »GETTIME2.TXT«
└─⟦6a1b9f2c5⟧ Bits:30005310/disk3.imd Open Access II v2.10 (dansk)
└─⟦this⟧ »GETTIME2.TXT«
! GETTIME2 - called by GETTIME to check the validity of the time string
! variable TEMPSTR, which has been stripped of its entry veil.
hours = INT(VAL(EXTRACT(tempstr,1,2)))
minutes = INT(VAL(EXTRACT(tempstr,3,2)))
seconds = INT(VAL(EXTRACT(tempstr,5,2)))
IF LENGTH(tempstr) > 6 !was there an AM/PM string
strpm = TRIM(EXTRACT(tempstr,7,2))
ELSE
strpm = ""
END IF
!increment good everytime we have an acceptable value
IF (seconds >= 0) and (seconds < 60)
good = good + 1
END IF
IF (minutes >= 0) and (minutes < 60)
good = good + 1
END IF
IF (hours >= 0) and (hours < 24)
IF (hours > 12) !24 hour time ?
USE24 = TRUE
good = good + 2 !hours and AM/PM good
strpm = ""
ELSE
IF (strpm = 'PM') or (strpm = 'AM')
IF (strpm = "PM") AND (hours <> 12) !hours in 24 hour format
hours = hours + 12
END IF
good = good + 2 !hours and AM/PM good
strpm = " " & strpm
ELSE IF (strpm = "") !and (USE24)
good = good + 2 !hours and AM/PM good
END IF
END IF
END IF
IF GOOD < 4
PUT DO BEEP
ELSE
ok = true
strseconds = string(seconds)
IF LENGTH(strseconds) < 2
strseconds = "0" & strseconds
END IF
strminutes = string(minutes)
IF LENGTH(strminutes) < 2
strminutes = "0" & strminutes
END IF
strhours = string(hours)
IF LENGTH(strhours) < 2
strhours = "0" & strhours
END IF
timestr = strhours & ":" & strminutes & ":" & strseconds & strpm
! compute total # of seconds into a floating point variable TVAL
tval = ((hours*3600)+(minutes*60)+seconds)*1.0
!debug
PUT TAB 12, "GETTIME: ", TIMESTR, tab 2, HOURS, TAB 2, MINUTES, ØØ
TAB 2, SECONDS, tab 2, TVAL
B = TRUE; GET B
END IF