home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_GEN
/
EDSV4064.ZIP
/
EPP-V1_1.ZIP
/
T.E
< prev
next >
Wrap
Text File
|
1993-06-26
|
2KB
|
64 lines
/*---------------------------------------------------------------------*/
/* Module systemTimeStr() function. This is necessary for KS1.3 users */
/* since we can't use the utilities.library, nor the DatetoStr() */
/* function of the newer OS. */
/*---------------------------------------------------------------------*/
MODULE 'dos/datetime', 'dos/dos'
PROC exp (n, p)
/* Computes n**p. */
DEF i, x = 1
FOR i := 1 TO p DO x := x * n
ENDPROC x
/* exp */
PROC itoa (str, int)
StringF (str, '\d', int)
ENDPROC str
PROC buildTimeStr (theString, hour, minute, second)
DEF tempStr [2] : STRING
SetStr (theString, 0)
VOID itoa (tempStr, hour)
IF hour < 10 THEN StrAdd (theString, '0', ALL)
StrAdd (theString, tempStr, ALL)
StrAdd (theString, ':', ALL)
VOID itoa (tempStr, minute)
IF minute < 10 THEN StrAdd (theString, '0', ALL)
StrAdd (theString, tempStr, ALL)
StrAdd (theString, ':', ALL)
VOID itoa (tempStr, second)
IF second < 10 THEN StrAdd (theString, '0', ALL)
StrAdd (theString, tempStr, ALL)
ENDPROC theString
/* buildTimeStr */
PROC systemTimeStr (theString)
DEF ds : PTR TO datestamp,
hour, minute, second
ds := DateStamp (New (SIZEOF datestamp))
hour := ds.minute / 60
minute := ds.minute - (hour * 60)
second := ds.tick / 50
Dispose (ds)
ENDPROC buildTimeStr (theString, hour, minute, second)
/* systemTimeStr */
PROC main ()
DEF systemTime [8] : STRING
VOID systemTimeStr (systemTime)
WriteF ('The current time is \s.\n', systemTime)
ENDPROC