Multiple String Array Combine , Save and reload

For general discussion related FlowStone
Post Reply
willzz32
Posts: 20
Joined: Thu Jul 29, 2010 7:59 pm

Multiple String Array Combine , Save and reload

Post 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
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Multiple String Array Combine , Save and reload

Post 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.
willzz32
Posts: 20
Joined: Thu Jul 29, 2010 7:59 pm

Re: Multiple String Array Combine , Save and reload

Post 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.
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Multiple String Array Combine , Save and reload

Post 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.
Post Reply