Procedure Adatim(VAR timstr: packed array [lo..hi:integer] of char); EXTERNAL; { *USER* Pascal-2 procedure to return formatted system date-time string. The format of the string is determined by the length of the string variable. See PAS$EXT:GENERAL.TYP for more info on the time/date type defs. The string variable TIMSTR must be a type0 or type1 string. The date/time string will be ASSIGNED to TIMSTR, so any previous contents of TIMSTR will be overwritten. The following time formats are output, where the number in the parantheses is the maximum length of the string variable. Ie. a DEC_timestamp (CH18) string or a STR18 string would return a format of DD-MMM-YY#HH:MM:SS. .lit HH:MM:SS (8) DD-MMM-YY (9) DD-MMM-YYYY (11) DD-MMM-YY HH:MM:SS (18) DD-MMM-YYYY HH:MM:SS (20) DD-MMM-YYYY HH:MM:SS.S (22) .eli If an error occurs, the supplied string will remain unchanged. Thus you can detect errors if desired, by clearing the string (or intialize it to some known value) prior to calling the ADATIM routine. If you cleared the string, after the ADATIM routine, you can call SLEN to see if the string is still zero length (ADATIM error occurred). In most cases, error checking is not needed, as there is little that can go wrong with this routine. However, if the string is to be used for an important function (as a key in an indexed file for example), it would be wise to check for errors. *WIZARD* No action will be done if the string supplied is not a type0 or type1 string, or if it does not conform to one of the recognized string lengths. The string supplied will not be changed. The GTIM$ directive is used to retrieve the current system date and time. If the directive fails, no action will be done, and the supplied string will not be changed. In all cases, the $DSW may be examined after the ADATIM call for the GTIM$ directive status, as no other directives are subsequently called. }