Consider the following simple code to creat a text.sys TEXT file.
program MakeAFile;
var
NewFile : TEXT;
DummyVar : INTEGER;
begin
assign(NewFile,'text.sys');
rewrite(NewFile);
writeln('Some text...');
DummyVar : 3;
writeln('Some other text...');
close(NewFile);
end.
My question is what the NewFile variable holding in the entire runtime? Did it hold the "Some text..." then transfer that to the disk then continue hold the "Some other text..." and transfer it to the disk,consecutively like that? Or it held both of the line and when the close(NewFile) is called then it transfer the two line at once? And if it the second case,then how the variable manage two value like that? I mean then it has to be some memories to reserved for the NewFile variable since the file can be unknown large. Thank you!