lengthly example on how to make save points please

Hi, I would like to know how to make save points in a script so the saved data can be accessed at a later time, i would like to see the code and examples of use and everything, i will not only look at posted code but i'll play with it so i can see what does what and etc...

thanks
Last edited on
I don't think anybody knows what you are talking about, you are being too vague. What is the purpose, what is the language of the "script" and what is a "save point" or the "data". I want you to post your code, or psudocode if you don't want any misunderstanding.
Create a struct or class that holds your data.
Create read(istream&) and write(ostream &) methods to read and write the contents of your class to/from a stream. Unless performance or security is critical, store it in ASCII form to help with debugging and testing.

Create a test file of the data.

Make a main() program that will read the test file and write the resulting record to cout. Modify the test file and test again until you're sure you have it right.

Now when you need to create a save point, just call the write() to save the data to your file. To restore the data, use the read() method.
Topic archived. No new replies allowed.