Hello
Mark,
>AssignFile(FileName,
File);
>ReWrite(FileName);
>Write(FileName,
'Data'); I
believe you meant something like:
var
F : TextFile;
FileName :
String;
begin
AssignFile(F, FileName);
ReWrite(F);
Write(F, 'Data');
The
answer, as far as I know, is you can't assign different files to the same
variable and use them dynamically.
To solve a "one variable - many text files" problem I
use threads. The
app I'm currently working on has to deal with potentially very large text files
(up to a gig in size) and export them into Excel.
Excel
can't handle such files, so my prog splits them into smaller ones
before exporting.
Each
thread uses the same procedures for writing/reading to/from text files and
export operations.
I have
text file variable set up as an attribute of a thread object. This way I can use
it with different files because it's local to each thread.
A bit
more tricky to program, but is quicker to run too.
Hope
this helps.
Cheers,
Sergei
Stenkov
|
- [DUG]: Referencing variable TextFile names Mark Howard
- Re: [DUG]: Referencing variable TextFile names Sergei Stenkov
- Re: [DUG]: Referencing variable TextFile n... Mark Howard
- Re: [DUG]: Referencing variable TextFi... Steve Peacocke
- RE: [DUG]: Referencing variable Te... Patrick Dunford
- Re: [DUG]: Referencing variab... Neven MacEwan
- RE: [DUG]: Referencing va... Patrick Dunford
- Re: [DUG]: Referencing variable Te... Mark Howard
- RE: [DUG]: Referencing variable TextFile names Patrick Dunford
- RE: [DUG]: Referencing variable TextFile names Edge, Martin (SSABSA)
- Re: [DUG]: Referencing variable TextFile n... Mark Howard
- Re: [DUG]: Referencing variable TextFi... Nello Sestini