Re: making multiple arrays with one file
Rofl.
Okay, to the actual solution, I think read_until method on file class is what you're searching for.
You just need to do something like:
string input=reader.read_until("\\^&\n", false);
if (input=="")
return;
string type=input[input.length()-1];
while (true) { input=reader.read_until("\\^&\n", false); input=string_replace(input, "\r", ""); //I hope I wrote parameters in right order, check it in documentation if it doesn't work, i don't remember what was the exact declaration if (input=="") break; string content=string_trim_right(input, 1); if (type=="\\") //WE have a name names.insert_last(content); else if (type=="^") //We have a description descriptions.insert_last(content); else if (type=="&") //There is a money value moneys.insert_last(content); //You will most likely have to parse here if moneys is array of ints, I don't remember how this was done in bgt, so you'll have to do it yourself. :) type=input[input.length()-1]; }
I think it should work just fine, although I would myself make rather one array of classes, however, that's another topic.
Best regards
Rastislav
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector