Recent

Author Topic: TFileTime  (Read 478 times)

Hugh3226

  • Newbie
  • Posts: 2
TFileTime
« on: January 17, 2020, 12:27:53 pm »
I'm converting a project from Delphi.
It uses Delphi functions:
TFileTime
SystemTimeToFileTime()
SetFileTime()

These don't seem to have Lazarus equivalents.
Any ideas?
Regards
Hugh

Handoko

  • Hero Member
  • *****
  • Posts: 3755
  • My goal: build my own game engine using Lazarus
Re: TFileTime
« Reply #1 on: January 17, 2020, 12:36:06 pm »

Hugh3226

  • Newbie
  • Posts: 2
Re: TFileTime
« Reply #2 on: January 17, 2020, 01:15:58 pm »
Thanks.
Found that I needed to include 'Windows' in the 'uses' section.
On to the next problem...the form changes size between design mode and run mode...I'll post a new question.
Regards

lucamar

  • Hero Member
  • *****
  • Posts: 3019
Re: TFileTime
« Reply #3 on: January 17, 2020, 01:51:34 pm »
Though there's no problem if your program is only for Windows, you don't need to use the Windows unit. As Handoko said, there are equivalent cross-platform functions in SysUtils (DatetimeToFileDate and viceversa, DateTimeToSystemTime and viceversa, FileAge, FileSetDate, etc.) and other units which would allow you to move your program to, say, Linux or MacOS without having to touch your code (at least in this respect).
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018