Once you have assigned a file (which you can do in one procedure) why can't you just pass the file variable as a parameter into other procedures?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mark Howard
Sent: Friday, 9 March 2001 13:21
To: Multiple recipients of list delphi
Subject: [DUG]: Referencing variable TextFile names

Hello - Newbie question.
 
I want to open two text files for writing to.
 
Which one I write to depends on a condition - but the procedures for opening and writing are common to both.
 
So there are several procedures which reference a FileName
eg
AssignFile(FileName, File);
ReWrite(FileName);
Write(FileName, 'Data');
 
where FileName is of type TextFile and File is a string.
 
My question is how can I have FileName as a 'variable' such that
under one condition it is FileOne
and under another it is FileTwo
 
and I can thus use the same procedures?
 
Hope this makes sense.
 
Mark
 

Reply via email to