home *** CD-ROM | disk | FTP | other *** search
- {->>>>GetDate<<<<----------------------------------------------}
- { This routine returns the current system date through DOS }
- { call $2A. It requires a prior definition of types DateRec }
- { and String80. DateString is formatted this way: }
- { }
- { July 17, 1986 }
- { }
- { DateRec = Record }
- { DateString : String80; }
- { Year,Month,Day : Integer }
- { End; }
- {--------------------------------------------------------------}
-
- Procedure GetDate(Var Today : DateRec);
-
-
- Type Reg = Record
- Case Boolean of
- True : (Word : Integer);
- False: (LoByte : Byte;
- HiByte : Byte)
- End;
-
- RegPack = Record
- AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : Reg
- End;
-
- String8 = String[8];
-
- Const MonthTags : Array [1..12] of String8 =
- ('January','February','March','April','May','June','July',
- 'August','September','October','November','December');
-
- Var Regs : RegPack;
- Dummy : String80;
-
- Begin
- Regs.AX.HiByte := $2A; MSDOS(Regs);
- With Today Do
- Begin
- Year := Regs.CX.Word;
- Month := Regs.DX.HiByte;
- Day := Regs.DX.LoByte;
- Str(Day,Dummy);
- DateString := MonthTags[Month] + ' ' + Dummy + ', ';
- Str(Year,Dummy);
- DateString := DateString + Dummy
- End
- End;