Id like to do something along the lines of this:
sOn=0
aCount=99
mColor=r
aColor=bOr even this would be acceptable (going back to a delimiting character)
<sOn=0>
<aCount=99>
<mColor=r>
<aColor=b>if that makes it easier?
In both cases, you have an implied end-of-record marker (the carriage return). Adding another one doesn't really buy you anything.
Is there a way to use the 'name' of the value/variable in the text file is parsing?
or do you just have to KNOW the order of the variables in the text file?
Of course there is:
if(strcmp(nameToken, "sOn") == 0)
sOn = atoi(valueToken); // Where sOn is a variable defined in your sketch
for example.. in my sketch I have a var declared called: maxAmmo
Then, one of the records in the file should be
maxAmmo = someValue
not
aCount = someValue
At least, that's the way I'd do it.
Im looking for more info/links/discussion about the parsing aspect...
Google strtok() (not strtok_r() - that's the thread-safe version; overkill on a single threaded system).