Dear all,
Another really simple question, not too important but I would like to know the answer for reference.
When coding arrays does it have a big impact on the code if you use 'huge' arrays rather than compact ones even if the majority of the array is empty?
For example.......If I have 10 names that I want to store in an array then the simplest way would be the first example below. Create an array with 10 points. However the second example below stores the same amount of data but using an array with a size of 10000.
DIM Name$(10)
For a = 1 to 10
Name$(a) = "Whatever"
Next
or
DIM NAME$(10000)
For a = 1 to 10000 Step 1000
Name$(a) = "Whatever"
Next
How much impact would the second way have on the code? Would it take up a lot more memory or would the increase in memory be very very minimal and thus not a problem?
Finally how much more space to multi dimensional arrays take than normal arrays?
For example how much less memory would a Dim test(500) use compared to a Dim test (500,10)
And how many dimensions can you go to? The Manual just says -
Dim array_name(index1[,index2][,index3][,...])
Which seems to indicate you can create as many dimensions inside the array as you like.......but in my experience I have never seen any that has more than 3 index levels.
Again I apologise for the basic questions, and also if I have misunderstood the most basic of functions.
Another really simple question, not too important but I would like to know the answer for reference.
When coding arrays does it have a big impact on the code if you use 'huge' arrays rather than compact ones even if the majority of the array is empty?
For example.......If I have 10 names that I want to store in an array then the simplest way would be the first example below. Create an array with 10 points. However the second example below stores the same amount of data but using an array with a size of 10000.
DIM Name$(10)
For a = 1 to 10
Name$(a) = "Whatever"
Next
or
DIM NAME$(10000)
For a = 1 to 10000 Step 1000
Name$(a) = "Whatever"
Next
How much impact would the second way have on the code? Would it take up a lot more memory or would the increase in memory be very very minimal and thus not a problem?
Finally how much more space to multi dimensional arrays take than normal arrays?
For example how much less memory would a Dim test(500) use compared to a Dim test (500,10)
And how many dimensions can you go to? The Manual just says -
Dim array_name(index1[,index2][,index3][,...])
Which seems to indicate you can create as many dimensions inside the array as you like.......but in my experience I have never seen any that has more than 3 index levels.
Again I apologise for the basic questions, and also if I have misunderstood the most basic of functions.