Save system - Demo and discussion inside

You definitely want to use loops for that, and you should parse the string instead of figuring out the length of the variable.

I think the biggest pain would be to figure out a way to register variables to be serialized, so the routine knows it. I think the only solution would be to hardcode it, or parse another string with the name of the variables, like in @Twiger_Fluff’s list implementation.

The deserialization routine would read the stream of characters looking for the separator character, in your case a comma. I would personally make this logic a little more robust to avoid splitting at the wrong place, for example if the value of a saved variable is a string which itself contains the separator character.

Like I said, it’s cumber some to build this system, but once in place it would be easier to use.

2 Likes