Posted 24 February 2013 - 10:25 PM
Hey guys. So I've heard you can save variables to a separate location in order to prevent you loosing them when shutting down minecraft. I've been wanting to learn how to do this for some time as most the programs I've written are at least 3/4 dedicated to trying to figure out their last task.
I'm about to try to write a chunk-loading program that'll need 2 variables to be saved; F and lastTask. I'd want a function something along the lines of writeF and getF, and ditto for lastTask. One function would be to write the variable to an existing file, or creating the file if necessary, and the other would pull the info and set it back as a variable within the main program. Could someone give me an example of how this would be done? I've found snippets of info on the web, but not enough to really comprehend how to do this. (I'm not a programmer.)
Also, if anyone has time, could you explain to me how to save all the variables I need to 1 location rather than separate ones for separate variables, and then to read them and set them as a variable within my main program again?
Thanks in advance!
I'm about to try to write a chunk-loading program that'll need 2 variables to be saved; F and lastTask. I'd want a function something along the lines of writeF and getF, and ditto for lastTask. One function would be to write the variable to an existing file, or creating the file if necessary, and the other would pull the info and set it back as a variable within the main program. Could someone give me an example of how this would be done? I've found snippets of info on the web, but not enough to really comprehend how to do this. (I'm not a programmer.)
Also, if anyone has time, could you explain to me how to save all the variables I need to 1 location rather than separate ones for separate variables, and then to read them and set them as a variable within my main program again?
Thanks in advance!