Page 1 of 1
Multiple String Array Combine , Save and reload
Posted: Mon Oct 06, 2014 10:44 pm
by willzz32
Hi All
Just wondering if anybody knows the best way to combine multiple string arrays so as to save to a text file and separate them on reloading the text file. It's no problem for me to create text save files for each array but with 36 arrays the save folder gets very messy. If i can combine them into one this would keeps things a bit more tidy.
Thanks in advance
Re: Multiple String Array Combine , Save and reload
Posted: Mon Oct 06, 2014 10:47 pm
by KG_is_back
You may use a char that you know will not be used in the strings as a delimiter. merge the string array elements, by delimiting it with that char. then use string to string array based on delimiter to reconstruct the original.
Re: Multiple String Array Combine , Save and reload
Posted: Mon Oct 06, 2014 11:00 pm
by willzz32
Hi KG_is_Back
Thanks for the fast response. I've tried as suggested but i may be getting mixed up some where, I'm using string array to string with a comma separator , and can reload the array with string to string array but i can't see when i would merge the multiple arrays and at what point to re split, Any chance you could post a quick diagram, I may be missing something in the tool box.
Thanks for the help.
Re: Multiple String Array Combine , Save and reload
Posted: Tue Oct 07, 2014 6:01 am
by RJHollins
If I follow correctly, I believe the 'Marshall' routine is one to consider.
With it, I save off a number of arrays that store to a single external file. Then on the loading, all arrays are stuffed into corresponding arrays.
As I've been told, this is a similar routine that FS uses for its' save/load.
Details on my quest for this may be over at the SM forum if not found here.
Hope that helps a bit.