[INHERIT('sys$library:starlet')] PROGRAM Use_XABDAT(INPUT,OUTPUT); VAR BDT, CDT, EDT, RDT : [QUAD,UNSAFE] RECORD F1,F2:INTEGER END; BDT_V, CDT_V, EDT_V, RDT_V : VARYING [32] OF CHAR; Filename : VARYING [32] OF CHAR; RVN : [WORD] 0..65535; F : TEXT; { Use a USER_ACTION routine to place a XABDAT XAB block in the } { XAB chain provided by the Pascal Run-Time Library. We will } { use the XAB block to obtain date/time information about the } { file being opened. } FUNCTION User_Action( VAR Fab : FAB$Type; VAR Rab : RAB$Type; VAR F : TEXT ) : INTEGER; VAR Status : INTEGER; XABDAT : [volatile] XAB$Type; BEGIN { Initialize the XABDAT record and } { link it into any existing XABs } WITH XABDAT DO BEGIN XAB$B_Bln := XAB$C_Datlen; XAB$B_Cod := XAB$C_Dat; XAB$L_Nxt := Fab.FAB$L_XAB; end; Fab.FAB$L_XAB := IADDRESS(XABDAT); { Do the $open } Status := $open(Fab); IF ODD(Status) THEN BEGIN { Save the date/time and revision information } WITH XABDAT DO BEGIN BDT := XAB$Q_BDT; CDT := XAB$Q_CDT; EDT := XAB$Q_EDT; RDT := XAB$Q_RDT; RVN := XAB$W_RVN; END; { The $open was successful, now do the $connect } Status := $connect(Rab); END; { Return status from $open/$connect } User_Action := Status; END; BEGIN WRITE('Filename? '); READLN(Filename); OPEN(File_Variable := F, File_Name := Filename, History := Readonly, User_Action := User_Action); { Format Backup/Creation/Expiration/Revision times that were } { collected by the User_Action routine with the XABDAT XAB. } $asctim(BDT_V.Length,BDT_V.Body,BDT); $asctim(CDT_V.Length,CDT_V.Body,CDT); $asctim(EDT_V.Length,EDT_V.Body,EDT); $asctim(RDT_V.Length,RDT_V.Body,RDT); { Write out the date/time strings } WRITELN('Filename: ',Filename,' has ',RVN:1,' revision(s)'); WRITELN('BDT = ',BDT_V,', CDT = ',CDT_V); WRITELN('EDT = ',EDT_V,', RDT = ',RDT_V); END.