
-----------------------------------
shadowNET
Mon Mar 19, 2012 4:31 pm

load/save
-----------------------------------
What is it you are trying to achieve?
I am trying to make a game and have the ability to save files/load files


What is the problem you are having?
I dont know how to save text such as the variavle values and call on them later when loading


Describe what you have tried to solve this problem
I have looked up commands and similar things and attempted to use them but have had little success

Please specify what version of Turing you are using
4.1.1

-----------------------------------
Fexter
Mon Mar 19, 2012 4:48 pm

Re: load/save
-----------------------------------
Try checking 'open' in the Turing documentation. That's the basic code you need for this.

For reading from the file, you want to use:

var f1 : int
var yourVar : yourVarType

open : f1, fileName, read % Open the file, so that it can be read from

read : f1,yourVar % Store the contents in the variable 'yourVar'

close : f1

And to write to it, use:

var f1 : int % A variable to use for opening the file; this will hold the file contents for writing
var yourVar : yourVarType % The variable you want to save

open : f1, fileName, write % Open the file

write : f1, yourVar % Write to the file

close : f1 % Close the file[/b]

-----------------------------------
evildaddy911
Thu Mar 22, 2012 4:07 pm

Re: load/save
-----------------------------------
your going to want to start off using get and put instead of read and write, but yeah thats the basics. [url=http://compsci.ca/v3/viewtopic.php?t=12972]click here for more information
