[fpc-pascal] Initialize

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jun 21 21:57:14 CEST 2006

On 21 jun 2006, at 20:38, Ewald Horn wrote:

> How do I initialize a variable of the type  : textfile ?
> I keep getting the following hints from the compiler using FPC but  
> I can't
> figure it out.
> Hint: Local variable "inFile" does not seem to be initialized

It is because the text/file parameter of assign()  is a "var"  
parameter, and "var" means that the input should already be valid.  
For some reason, all the assign() variants are defined as

Procedure Assign({$ifdef PARAOUTFILE}out{$else}var{$endif}  
t:Text;const s:String);

I don't know why this "PARAOUTFILE" is never defined (maybe a bug in  
the compiler which causes problems when defining a text/file  
parameter as "out"?)


More information about the fpc-pascal mailing list