DBUG:
Procedure Dbug(Name: STRING);
BEGIN
IF Name='Clear' THEN ReWrite('Dbug') ELSE BEGIN
Append('Dbug');
WriteLn(Name);
END;
Close('Dbug');
END;
"DBUG" because I use it to write variables into a debugging file at different stages of script execution...but it also works well for data files.
Because it keeps appending to the file and closing it, the script can crash or stop and you will still find a record up until where the script was successful. Send: "Dbug('Clear');" to erase the dbug file at the beginning of the script, then something like:
Dbug(Concat('Repeat loop x=',x,', y=',y));
to create a log during script execution.
Another tip: Use "Log: BOOLEAN" variable or constant at beginning of script to turn dbug recording on and off:
IF Log THEN Dbug(Concat('Test1 n=',n));