<div dir="ltr"><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 13, 2019 at 8:03 PM Ched <<a href="mailto:charles.edouard.des.vastes.vignes@gmail.com">charles.edouard.des.vastes.vignes@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
In <a href="https://www.freepascal.org/docs-html/rtl/sysutils/filenameroutines.html" rel="noreferrer" target="_blank">https://www.freepascal.org/docs-html/rtl/sysutils/filenameroutines.html</a> ,<br>
<br>
FileSetDate <<a href="https://www.freepascal.org/docs-html/rtl/sysutils/filesetdate.html" rel="noreferrer" target="_blank">https://www.freepascal.org/docs-html/rtl/sysutils/filesetdate.html</a>>Get file dates should be <br>
corrected to _S_et .<br></blockquote><div>I don't see any mix-up of Get and Set on either the FileSetDate or FileGetDate pages at your link above.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Now, my real problem is that the following code is compiled when SYS is not defined, and isn't when it <br>
is, and I really don't know why.<br>
<br>
PROGRAM QQ;<br>
{ $DEFINE SYS}<br>
USES<br>
{$IFDEF SYS}<br>
SYSUTILS;<br>
{$ELSE}<br>
DOS;<br>
{$ENDIF}<br>
VAR<br>
FO: FILE OF DOUBLE;<br>
L: LONGINT;<br>
BEGIN<br>
ASSIGN(FO, 'blabla.bin');<br>
RESET(FO);<br>
{$IFDEF SYS}<br>
L:=FILEGETDATE(FO); { Got File, expected LongInt }<br>
{$ELSE}<br>
GETFTIME(FO, L);<br>
{$ENDIF}<br>
CLOSE(FO);<br>
END.<br></blockquote><div><br></div><div><div>The file variable FO in your code should be declared as type THandle (which is an alias for LongInt) when you are using the SysUtils file handling routines. Take a look at the example at the bottom of FileCreate (<a href="https://www.freepascal.org/docs-html/rtl/sysutils/filecreate.html">https://www.freepascal.org/docs-html/rtl/sysutils/filecreate.html</a>) to see how to work with these routines.</div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Well, it appears that I prbably haven't fully understand the dos->sysutils conversion.<br></blockquote><div><br></div><div>You are mixing classic Pascal style file handling (Assign, Reset, Close) which isn't (AFAIK) Dos style, with an alternative file handling style defined in SysUtils.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Cheers, Ched'<br></blockquote><div> </div></div></div>