On Mon, 16 May 2011 10:28:19 +0000, [email protected]
wrote:
> thanks all - btw it wasn't the real code just an example I
made up , the while loop wasn't needed- mistake!
>
>But the q still
remains - having three functions would still give the problem I have
now- that when doing a file_read (my function flag=1) would say 'file
not open' because the handles are volatile & local to file reset - >that
was the point of my original email. Seems as if there is no solution?
>John
Of course there is. As was stated earlier you need to make the
filehandle a global not a local variable. You could also handle it
differently and use a TStringList instead.
var
s: TStrings;
s :=
TStringList.Create;
s.LoadFromFile('MyFile.txt');
//do something with
line 12
writeln(s[12]);
s.Free
Regards, Darius
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal