previous next top contents index framed top this page unframed
Figure 30–21. $assembleTime
| LONG INTEGER PROCEDURE $assembleTime (INTEGER hour; OPTIONAL INTEGER minute,second; OPTIONAL BITS ctrlBits; PRODUCES OPTIONAL BOOLEAN success); |
$assembleTime returns a MAINSAIL time given the hour, minute, and second.
hour must be between 0 and 23, inclusive, and minute and second between 0 and 59, inclusive. All other values generate an error. If an erroneous input value is detected, 0L is returned and success is set to FALSE; success is set to TRUE if no error occurs. Note that 0L is also a valid return value if $timeDifference is set in ctrlBits and the time difference is zero seconds; the value of success must be examined to distinguish this case from an error.
The valid ctrlBits bits are $localTime, $gmt, $timeDifference, and errorOK.
If $localTime is specified (or if neither $localTime nor $gmt is specified), the input values interpreted as a local time and returned in local time format. If $gmt is specified, a GMT format time is returned. If $timeDifference is specified, hour, minute, and second are treated as a time difference; i.e., the value returned is:
cvli(hour) * 3600L + cvli(minute) * 60L + cvli(second)
Unless errorOK is specified, an error message is generated for erroneous input values.
The standard MAINSAIL date and time formats are described in Section 24.1.
MAINSAIL Language Manual, Section 30.22