At 05:33 pm 8/03/01 -0800, Mark Howard said:
>>>>
In fact, to state it again - more clearly this time. I'm sorry for the
earlier muddle.
I want to be able to do something like the following:
Var
FileName, FileOne, FileTwo : TextFile;
File : String;
begin
if cond1 then
begin
FileName := FileOne;
File := 'FileOne.txt';
end
else
begin
FileName := FileTwo;
File := 'FileTwo.txt';
end;
AssignFile(FileName, File);
Rewrite(FileName);
Write(FileName, 'Data', 'MoreData');
end;
But I can't go
FileName := FileOne;
I get this error message "Operator not applicable to this operand type"
That's the problem. I'm sure it's very basic - I've just never had to do it
before and can't think where else to look in the Help files.
Mark
<<<<
Mark, perhaps I'm missing something here, but can't you just do this ...
Var
FileName: TextFile;
File : String;
begin
if cond1 then
File := 'FileOne.txt'
else
File := 'FileTwo.txt';
AssignFile(FileName, File);
Rewrite(FileName);
Write(FileName, 'Data', 'MoreData');
end;
Steve
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"