New games every week!
JSE - Load and Save Blog
24th May 2021
Want to save the highscore?
You can do that, now!

-=-=-

I've added another array into the mix.
The Save File is an array of 256 elements that you can pop your scores into or anything else you might like to store along the way.
WriteFile(Slot,Value) and Value=ReadFile(Slot) are used to place and retrieve values in this "file", and don't forget to SaveFile when you're done.
There's a LoadFile command, too, as well as an EmptyFile command to flood-fill the "file" with 0's.

The save file should (!!) also get stored when you use the Export/Import functionality of the engine, so that's a teensy bit future-proofed.

Meanwhile...



New command SplitString(String,Split,nth) appears!
eg.. ThirdWord=SplitString("What is the third word"," ",3)
This lets you quickly check for the nth iteration of a split string, without needing to faff about with arrays.

If you'd prefer to do it with arrays, though, I also added count=Explode(String,Split,ArrayName) and BigString=Join(ArrayName,Joiner), to take the string and split it into an array, or vice versa.
It won't automagically create the array, though, so be sure you've got that at the ready, beforehand!

Examples are, as always, in the Command List file.
Views 215, Upvotes 27  
Daily Blog , Jse , New Commands
New games every week!
Site credits : Jayenkai, one crazy fool who has far too much time on his hands.
(c) Jayenkai 2023 and onwards, RSS feed 81

Blog - JSE - Load and Save - AGameAWeek