I can not handle this procedure, in my opinion the following should work to get the month, but the last line "m:=MyDateTime.month;" fails compiling with error: unexpected "." What's wrong with it, MyDateTime is of type DateTimePtr?
Const SYSTRAP = $4E4F; sysTrapTimSecondsToDateTime = $A0FC;
Type UInt8 = -128..127; Uint16 = 0..65535; UInt32 = integer;
DateTimeType = record second: UInt16; minute: UInt16; hour: UInt16; day: UInt16; month: UInt16; year: UInt16; weekDay: UInt16; // Days since Sunday (0 to 6) end;
DateTimePtr = ^DateTimeType;
var MyDateTime : DateTimePtr; m : integer;
(* ===== TIME =====*) function TimGetSeconds:UInt32; inline(SYSTRAP,$A0F5); function TimGetTicks:UInt32; inline(SYSTRAP,$A0F7); procedure TimSecondsToDateTime(seconds: UInt32; dateTimeP: DateTimePtr); inline(SYSTRAP, sysTrapTimSecondsToDateTime);
begin TimSecondsToDateTime(TimGetSeconds,MyDateTime); m:=MyDateTime.month; end.
Thanks in advance. Reinhard. |