Hi, this is probably a noob question, but I have found good help and activity here so I hope I can get help with this other issue with a board game me and my friend is programming :)<br><br>The program consist of an instance (current-game) of our class game% and a GUI (frame%). And we want to add a save option to the menu.<br>
<br>;This is almost the first line of code in the program<br>(define current-game (new game&))<br><br>Can we print current-game to a file with a command such as:<br><br><span class="ScmPn">(define out (open-output-file "save001.sav")</span><span title="Provided from: scheme/base, scheme"><span class="ScmSym"></span></span>)<br>
(write current-game out)<br>(close-output-port out)<br><br>and load it with<br><br>(define in (open-input-file "save001.sav"))<br>(set! current-game (read-line in))<br>(close-input-port in)<br><br>Is it possible to do something similar in a method to the game% class (refer to the instance itself)? Or do we have to store all members of the game% instance one by one?<br>
Will the loading get screwed up with we change a minor thing in the game%-class?<br><br>// David (does anyone want to take a look on our code? This is our first (graphical!) game and we would love all the help we can get. :))<br>