Discussion:
Open Ended Arrays or Similar Data Structures
Hal Vaughan
2011-06-19 02:35:03 UTC
Permalink
Is there any way, in OOo BASIC, to create something like a vector or linked list or anything that gives me something like an array that I can keep adding elements to? (Everything I found with an array indicated it has to be declared with a set number of members.)


Thanks!



Hal--
-----------------------------------------------------------------
To unsubscribe send email to dev-***@api.openoffice.org
For additional commands send email to ***@api.openoffice.org
with Subject: help
Ariel Constenla-Haile
2011-06-19 02:48:30 UTC
Permalink
Hello Hal,
Post by Hal Vaughan
Is there any way, in OOo BASIC, to create something like a vector or linked
list or anything that gives me something like an array that I can keep
adding elements to? (Everything I found with an array indicated it has to
be declared with a set number of members.)
search in the OOo help "ReDim"

Sub Test_Array
Dim arr(0) as Integer
arr(0) = 0

Dim i%
For i = 1 To 10
ReDim Preserve arr(i)
arr(i) = i
Next
End Sub


Regards
--
Ariel Constenla-Haile
La Plata, Argentina
Hal Vaughan
2011-06-21 15:59:09 UTC
Permalink
Thank you. I saw ReDim, but from what I read (and it wasn't an actual OOo web page, so it wasn't official), it looked like using it destroyed the current array. Now I'm straight on that.


Hal
Post by Ariel Constenla-Haile
Hello Hal,
Post by Hal Vaughan
Is there any way, in OOo BASIC, to create something like a vector or linked
list or anything that gives me something like an array that I can keep
adding elements to? (Everything I found with an array indicated it has to
be declared with a set number of members.)
search in the OOo help "ReDim"
Sub Test_Array
Dim arr(0) as Integer
arr(0) = 0
Dim i%
For i = 1 To 10
ReDim Preserve arr(i)
arr(i) = i
Next
End Sub
Regards
--
Ariel Constenla-Haile
La Plata, Argentina
--
-----------------------------------------------------------------
To unsubscribe send email to dev-***@api.openoffice.org
For additional commands send email to ***@api.openoffice.org
with Subject: help
Loading...