-
Files and arrays
I'm trying to create an application for my football game, which allows the user to load information sent by me into the application, make changes, then save the information back to the file and return it to me by email. This is currently working with a Visual Basic application which I'm now hoping to upgrade.
Firstly, I need to load the file and then split it into various arrays. Since the file is just a very long list of text strings (I didn't delimit them with comma's or anything, so it's just 1 string per line), what would be the best way to load the file and split it?
So, I guess the most basic questions I need answering at the moment are, how do I actually load in my file and how should I initially store it? I've looked at the file and open dialog extensions but none of them seem to actually have an option to load anything.
-
Re: Files and arrays
If it's one string per line, the List object might be what you're looking for - it's usually used as a Windows control for displaying on screen, but if it's set to invisible and off to the side of the frame, you can use it as a data store. Use the "Load list file" action to point it to the file to load, and it'll come back with each line of the text file on a separate line of the list object.
From there, the String Parser 2 object is one object that can split lines up and interpret them - there are several others as well depending on what you need to do with them.
-
Re: Files and arrays
Ahh perfect, that's just what I needed and I hadn't even considered the list object. Seems to have solved most of the questions I had in one go, thanks a lot :)