* * *

Author Topic: Problem converting for Delphi code for dealing with 64bit file dates  (Read 2453 times)

vfclists

  • Full Member
  • ***
  • Posts: 167
    • HowTos Considered Harmful?

This is a follow up to http://forum.lazarus.freepascal.org/index.php/topic,8902.0.html.

The TULargeInteger used by Lazarus does not appear to support the record members for the LowPart and HighPart. What are the Lazarus equivalents?

Code: [Select]
function TVersionInfo.GetFileDate: int64;
var
  LargeInteger: TULargeInteger;
begin
  if (Valid) and (FFileInfo <> nil) then
  begin
    LargeInteger.LowPart := FFileInfo.dwFileDateLS;
    LargeInteger.HighPart := FFileInfo.dwFileDateMS;
    Result := LargeInteger.QuadPart;
  end else
    Result := 0;
end;

   
Lazarus 0.9.28.2/FPC 2.4.0/Windows
Lazarus 0.9.30.1/FPC 2.4.4/Windows
Lazarus 0.9.31.1/FPC 2.5.1/Linux

Mooji and the Sound of Wood Chopping
your Self, The Projector
The Strange Case of the ZX81

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1182
Re: Problem converting for Delphi code for dealing with 64bit file dates
« Reply #1 on: March 14, 2010, 10:18:15 pm »
(I don't see the relation to the other report?)

Anyway, it is hard to reproduce without a complete compilable program (preferably a simple console app without lazarus dependancies) to reproduce.

vfclists

  • Full Member
  • ***
  • Posts: 167
    • HowTos Considered Harmful?
Re: Problem converting for Delphi code for dealing with 64bit file dates
« Reply #2 on: March 14, 2010, 11:04:32 pm »
It is another part of the same unit and  I have attached the project here.
I haven't gotten round to doing console only apps yet, the form is the application default form.

(I don't see the relation to the other report?)

Anyway, it is hard to reproduce without a complete compilable program (preferably a simple console app without lazarus dependancies) to reproduce.
Lazarus 0.9.28.2/FPC 2.4.0/Windows
Lazarus 0.9.30.1/FPC 2.4.4/Windows
Lazarus 0.9.31.1/FPC 2.5.1/Linux

Mooji and the Sound of Wood Chopping
your Self, The Projector
The Strange Case of the ZX81

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1182
Re: Problem converting for Delphi code for dealing with 64bit file dates
« Reply #3 on: March 15, 2010, 12:10:53 pm »
(T)ULARGE_INTEGER has been changed to the native 64-bit type QWORD  (unsigned 64-bit). I assume to fix a different kind of usage in headers. (but it is there since SVN rev 1).

"LARGE_INTEGER" still works with lowpart and highpart.



 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads