Don't know if there is no read the source file, or not write to the target file, copy the file size 0 k
CodePudding user response:
You are in opened fromfile read-only files, but not read data; And then to write only opened the tofile also does not have written to the file, so your text size certainly is 0,Opens an open is read, a writing, but not to read and write operations, should remember correctly this is the situation,
CodePudding user response:
The data read and write operations should use API function? Demand is determined there is no memory and file stream copyCodePudding user response:
ReadRead one or more values from a file into one or more variables,
Readln
In a text file that executes the first Read operation and jump to the asm,
The Write
To write a file or multiple values,
Writeln
Performs the Write operation in a text file and then Write a line end (the end - of - line) tag,
Var
Bat: textfile;
S: a string;
The begin
Assignfile (bat, 'c: \ 123123. Bat');
Reset (bat);
Readln (bat, s);
Memo1. Lines. The Add (s);
Closefile (bat).
end;
========================================
Var
Bat: textfile;
The begin
Assignfile (bat, 'c: \ 123. TXT);
Rewrite (bat).
Writeln (bat, '1111111111111111');
Closefile (bat).//close the file
end;