Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?

ReDim

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-16-2010, 01:09 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default ReDim

Hi

I can remember from my VB days the function "ReDim". If you had an array with say 10 values you would specify DIM A(9). If you now received more values in this array, say another 6, then you could use the function ReDim A(15) without losing any of your old data.

This would become handy in my "CAD" program. As the user adds more entities to a drawing one could have a subroutine to increase the "DIM" to suit the number of entities in the drawing.

Or is there a way of which I am not aware?

Thanks
Michael
Reply With Quote
  #2 (permalink)  
Old 08-16-2010, 02:19 PM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

See http://www.basic4ppc.com/forum/addit...html#post16447?

Mike.
Reply With Quote
  #3 (permalink)  
Old 08-17-2010, 04:15 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 312
Default

Hi mjcoon

Thanks for the reply, but I fail to see how that can help me. Is it possible for an example please?

Thanks
Michael
Reply With Quote
  #4 (permalink)  
Old 08-17-2010, 07:45 AM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by ceaser View Post
Thanks for the reply, but I fail to see how that can help me. Is it possible for an example please?
No, I can't write an example because there are so many ways of approaching it. The simplest would be to use an ArrayList for holding the data but perhaps that would be too much of a re-write and/or a hit on performance.

I had in mind that using
AddArray(array As Array()) : Adds the contents of array to the end of the items (if any) already in the ArrayList.
and
ToArray() : Returns an array containing copies of all the elements of the ArrayList.
you can use the extensibility of ArrayList just when you want to expand your array but put the data back into a plain array. But the decisions depend on how you use your arrays and where the overheads are best kept.

Mike.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT. The time now is 02:20 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0