zero-tolerance Posted November 8, 2006 Report Share Posted November 8, 2006 Hi everyone, I am trying to save the data that I have in an array into the file format as shown below. The input array only contains numbers on it but it is on a string format. The words and the writting that is shown in the attachment must be added to the file automatically. Is there a way of doing so. The problem is not just writting into a file but also being able to load the data i.e. the numbers that are saved into the file and input that into a string array just as it was at the beggining before the array was saved into the file. Would anyone ahve an idea of how to do around this problem at all. the atached file can be opened using Notepad thanks in advanced Download File:post-4068-1162989372.txt Quote Link to comment
Yair Posted November 8, 2006 Report Share Posted November 8, 2006 There are functions in the String palette to convert an array to a string and vice-versa, so that should take care of the array part. To find the actual array when you read from the file you need to find the last semicolon and read what's after it. You can do this by searching the string in a loop (or reversing it and searching for the first occurence) or perhaps by converting the entire file to an array with a semicolon as the delimiter. Quote Link to comment
zero-tolerance Posted November 9, 2006 Author Report Share Posted November 9, 2006 There are functions in the String palette to convert an array to a string and vice-versa, so that should take care of the array part.To find the actual array when you read from the file you need to find the last semicolon and read what's after it. You can do this by searching the string in a loop (or reversing it and searching for the first occurence) or perhaps by converting the entire file to an array with a semicolon as the delimiter. Thanks for the reply, but I'm actually using something known as "State Memory" to create the Arrays and finally I'm creating a 2D array from all of the results that I have and Saving it on users choice. I'm posting the example just incase someone else needs it. Thanks again for your reply Download File:post-4068-1163116683.zip Quote Link to comment
Yair Posted November 10, 2006 Report Share Posted November 10, 2006 I fail to see how your second post has anything to do with the first, pther than that you have the two arrays there (and they're numeric arrays, not string). If you still want to save and load to a file, then you just need to add a couple of states to your functional global which will go along the lines of what I previously suggested. Incidentally, this type of global is quite common and has many names - "USR global", "LV2-style global", "Action engine", "Functional global (FGV)", etc. Hopefully, it's known by all LAVA members who have been using LV for any length of time. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.