I am trying to put together a short program to build a script file.
I declare the file as:
Uses sysutils;
{$H+I-}
Var
SFile : Text;I then assign a name to the file :
Assign(SFile, SName);Now, I only want to create the file if some conditions are met. Since this is in a loop I thought I could do this:
If (SFile.Mode = fmClosed) Then Rewrite(SFile);But this line gives the error
Error: Illegal qualifier
and the location in the line is at the 'o' in Mode.
I vaguely remember doing things like this in Turbo/Borland Pascal many years ago. It should be possible to do this with Free Pascal?
I'm using
Free Pascal Compiler version 2.6.4 [2014/03/03] for x86_64 on Linux.
What am I doing wrong?
thanks
Rolf Grunsky
