New topic: Two-dimensional array
<http://forums.realsoftware.com/viewtopic.php?t=29261> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message Intelligent007 Post subject: Two-dimensional arrayPosted: Tue Jul 28, 2009 1:19 am Joined: Tue Jul 28, 2009 1:08 am Posts: 1 Hello, I'm programming now since 6 months and I really like it. Althoug I still have problems to read data from a .txt file (doubles with ";" separator) and store this data in a two-dimensional array in my program. How do you do this? I tried several times with i, j (for rows and columns) but I cannot assign the value that is read from the file into my two-dim array. It does not work with the "append" method. And the problem is that I try to assign a value (which is one-dim) to an array (which is two-dim); can anyone help me please??? Thank you so much; regards, elisabeth Top Steve Garman Post subject: Re: Two-dimensional arrayPosted: Tue Jul 28, 2009 2:03 am Joined: Fri Sep 30, 2005 3:53 pm Posts: 2834 Location: England Append only works with one-dimensional arrays. If you are creating a two-dimensional array of which the size is unknown at the start, you may find ReDim useful. I'm having trouble visualizing exactly what you are trying to do but it sounds like you need to read from the file a line at a time, use Split on the line to produce a new one-dimensional array and loop around that array inserting the data into your two-dimensional array. Perhaps you could show us some data from the file so we can see what you are tring to work with. For instance, are there always the same number of values in each line? _________________ Steve Garman Using REALbasic 2008r2 Professional on Windows Vista Ultimate and REALbasic 2009r3 Professional on Linux Ubuntu 9.04 Desktop Occasional blog Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
