SRL Archive - Help and Support

About the Save and Open Functions...


Pure1993

2008-07-16 16:22:06

Well, I am trying around a bit at the moment, and I came across the saving and opening functions, and now I was wondering: How exactly do the the saving commands work, especially the one SaveToFile and OpenFromFile? (Caution: Long sentence up ahead:eek:!') Because I am working on a little data colection for a script (which I will probably never write, curse you laziness! :fiery: ), and seeing as I am too lazy (there ist that word again :fiery: ) to make it writeln everything and then copy the debug box into a word processing programm, and then save it, and then again open it, add the information, and save it again every single time I want to add to the data, I was thinking if it is possible to simply save the integers directly, and later open it and add the new integers to it…
(Please doen't ask me what script I am working on… The only thing I will say that it could be included in other scripts to generally improve them, so yeah… ;))
Thank you,
-Pure1993

BTW: About my activity… ummm… I'm still around… sorta…. it's just that I don't feel like posting a lot… and considering that probably about 75% (or more) of all posts basicly hold already posted information (or questions, or spam), it is not a big loss to the community, if it a loss at all ;)

Harry

2008-07-16 16:28:40

I dunno how to answer your whole question, but this procedure will save a debug window into a txt file ^^.


procedure SaveDebug;
var FileNum: integer;
begin
FileNum := RewriteFile(ScriptPath+'Debugtxt',True);
if( FileNum < 0 )then
WriteLn('@@@ Error with save: File Error.');
WriteFileString(FileNum, GetDebugText);
CloseFile(FileNum);
end;

Pure1993

2008-07-16 16:38:26

Thanks for your fast answer… always getting this error though:
[Runtime Error] : Exception: Access violation at address 006CF23E in module 'scar.exe'. Read of address FFFFFFFC in line 8 in script

Ah well, i didn't quite get it anyway, but heck, still thanks :D