new script function : appendToFile
Posted: 30 Oct 2023, 18:05
Hi,
For datalogging, it would be cool to have in the script language "st.appendToFile(filename)" just like saveToFile, but not erasing the file each time it is open.
the procedure
procedure SaveToTextFile;
begin
st.create;
st.loadFromFile(fname.asString);
st.add(input.asString);
st.saveToFile(fname.asString);
st.free;
end;
would become
procedure SaveToTextFile;
begin
st.create;
st.setText(input.asString);
st.AppendToFile(fname.asString);
st.free;
end;
Cheers
Olivar
For datalogging, it would be cool to have in the script language "st.appendToFile(filename)" just like saveToFile, but not erasing the file each time it is open.
the procedure
procedure SaveToTextFile;
begin
st.create;
st.loadFromFile(fname.asString);
st.add(input.asString);
st.saveToFile(fname.asString);
st.free;
end;
would become
procedure SaveToTextFile;
begin
st.create;
st.setText(input.asString);
st.AppendToFile(fname.asString);
st.free;
end;
Cheers
Olivar