Hi
I am working on a program to perform various alterations and calculations on CNC Gcode.
The problem I'm having is how to start an operation on an existing file, after the file is opened and displayed in a TRichEdit.
Id like to use 'in memory' processing instead of reading each line of the richedit to try to avoid performance problems.
I have a test procedure which doesn't work here, could someone point out what I'm doing wrong ?
I know its basic but it's got me stumped.
Hope I'm making sense.
Thanks
Andrew.
I am working on a program to perform various alterations and calculations on CNC Gcode.
The problem I'm having is how to start an operation on an existing file, after the file is opened and displayed in a TRichEdit.
Id like to use 'in memory' processing instead of reading each line of the richedit to try to avoid performance problems.
I have a test procedure which doesn't work here, could someone point out what I'm doing wrong ?
I know its basic but it's got me stumped.
Hope I'm making sense.
Thanks
Andrew.
Code:
[b]procedure[/b] TForm1.InsertBlockNumbersClick(Sender: TObject);
Var
infile, outfile: TextFile;
inBuffer,outBuffer: [b]array[/b][[purple]1..65536[/purple]] [b]of[/b] char;
[b]begin[/b]
AssignFile(Infile, FullFileName);
reset(infile);
System.SetTextBuf(infile, inBuffer);
System.SetTextBuf(outfile, outBuffer);
AssignFile(outfile, FullFileName);
rewrite(outfile);
writeln(outfile, [teal]'(Tests InsertBlockNumbers.)'[/teal]);
[b]while[/b] [b]not[/b] eof(infile) [b]do[/b]
[b]begin[/b]
[navy][i]//Do Something
[/i][/navy] [b]end[/b];
CloseFile(infile);
CloseFile(outfile);
[b]end[/b];