8,452
edits
Paradox-01 (talk | contribs) mNo edit summary |
Paradox-01 (talk | contribs) mNo edit summary |
||
Line 461: | Line 461: | ||
' '''[1] | ' '''[1] creating and extending an array''' | ||
' creating an array | |||
' () sets the number of array items | |||
redim nums (3) | |||
for i = 0 to 3 | |||
nums(i) = (i) | |||
for i = 0 to | |||
next | next | ||
logmessage " | logmessage "output all items" | ||
for each n in nums | |||
logmessage n | |||
next | |||
logmessage "first array item holds: " & lbound(nums) | |||
logmessage "last array item holds: " & ubound(nums) | |||
logmessage "-------------------------------------" | |||
' extending an array | |||
' use "preserve" to keep the old content | |||
' find next higher value | |||
plus_one = ubound(nums) + 1 | |||
redim preserve nums (plus_one) | |||
nums(plus_one) = 4 | |||
for each n in nums | |||
logmessage n | |||
next | |||
logmessage "first array item holds: " & lbound(nums) | |||
logmessage "last array item holds: " & ubound(nums) | |||
' INFO : output all items | |||
' INFO : 0 | |||
' INFO : 1 | |||
' INFO : 2 | |||
' INFO : 3 | |||
' INFO : first array item holds: 0 | |||
' INFO : last array item holds: 3 | |||
' INFO : ------------------------------------- | |||
' INFO : 0 | |||
' INFO : 1 | |||
' INFO : 2 | |||
' INFO : 3 | |||
' INFO : 4 | |||
' INFO : first array item holds: 0 | |||
' INFO : last array item holds: 4 | |||
edits