DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC759 "Piccoline"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC759 "Piccoline"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦54eb01022⟧ TextFile

    Length: 1277 (0x4fd)
    Types: TextFile
    Names: »TVAL2STR.TXT«

Derivation

└─⟦6a1b9f2c5⟧ Bits:30005310/disk3.imd Open Access II v2.10 (dansk)
    └─⟦this⟧ »TVAL2STR.TXT« 

TextFile

! TVAL2STR - converts time floating point value to a time string 
! Send in Variables:
!   TVAL: (floating point) total number of seconds.  TVAL must be sent in 
!      as a floating point value computed the same as STR2TVAL's TVAL.
!   USE24: (logical) TRUE returns 24 hour time, FALSE AM/PM format 
! Returned Variables:
!   TIMESTR:  (string) time string in 24 hour format or AM/PM format

hours      = int(tval / 3600) 
strminutes = string(int(tval mod 3600) / 60) 
strseconds = string(int((tval mod 3600) mod 60))
strpm = "" 
IF not use24
   strpm = ' AM'
   IF hours > 11 
      strpm = ' PM'
      IF hours > 12
        hours = hours - 12
      END IF 
   END IF 
END IF 
!pad with zeroes to two digits 
IF LENGTH(strseconds) < 2 
   strseconds = "0" & strseconds
END IF 
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 

!DEBUG
PUT "TVAL2STR = ", tval,TAB 2
IF USE24 
   put " 24 hour time: "
ELSE
   put " AM/PM time: "
END IF 
put TIMESTR, DO NEWLINE 
B = TRUE; GET B

strpm END
strseconds END
strminutes END
strhours END
hours END 
b END