New topic: Best way to clear an array.
<http://forums.realsoftware.com/viewtopic.php?t=33990> Page 1 of 1 [ 7 posts ] Previous topic | Next topic Author Message waveuponwave Post subject: Best way to clear an array.Posted: Thu May 27, 2010 7:42 pm Joined: Fri Jan 29, 2010 12:39 pm Posts: 288 Location: Virginia U.S.A. What is the best way to clear an array. I am using the same array for two different functions and I am appending to it. I would like to be able to clear the array back to nothing with a command. How do I do that? Thanks. _________________ RB2010r2 Pro on Win 7 I promise to help if I ever learn how to help myself. Top timhare Post subject: Re: Best way to clear an array.Posted: Thu May 27, 2010 7:50 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 7831 Location: Portland, OR USA redim myArray(-1) Top guykuo Post subject: Re: Best way to clear an array.Posted: Thu May 27, 2010 7:50 pm Joined: Mon Apr 02, 2007 5:51 pm Posts: 260 redim myarray(-1) Top guykuo Post subject: Re: Best way to clear an array.Posted: Thu May 27, 2010 7:51 pm Joined: Mon Apr 02, 2007 5:51 pm Posts: 260 jinx! Top waveuponwave Post subject: Re: Best way to clear an array.Posted: Thu May 27, 2010 7:51 pm Joined: Fri Jan 29, 2010 12:39 pm Posts: 288 Location: Virginia U.S.A. I tried that but when I try and append to it with the new data directly after I redim it there is nothing in it. _________________ RB2010r2 Pro on Win 7 I promise to help if I ever learn how to help myself. Top waveuponwave Post subject: Re: Best way to clear an array.Posted: Thu May 27, 2010 7:57 pm Joined: Fri Jan 29, 2010 12:39 pm Posts: 288 Location: Virginia U.S.A. How do I use ubound with this command? Maybe that would help. _________________ RB2010r2 Pro on Win 7 I promise to help if I ever learn how to help myself. Top waveuponwave Post subject: Re: Best way to clear an array.Posted: Thu May 27, 2010 8:06 pm Joined: Fri Jan 29, 2010 12:39 pm Posts: 288 Location: Virginia U.S.A. Sorry guys! You were right. I misunderstood the use of the (-1) part. I was trying to use the size of the array (arraycount) instead of the (-1). It worked great! Thanks. _________________ RB2010r2 Pro on Win 7 I promise to help if I ever learn how to help myself. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 7 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]
