Hi,
primo basically nailed the stringBuilder usage, here a little example:
Uses "console", "stringBuilder"
' this will store the numbers:
Dim builder as new StringBuilder()
' access the numbers virtually:
Dim myNumber() as Number At 0
Dim i As Long ' just to list our arrays elements
' add a few elements, type Ext equals Number, that's why MKE$:
builder.Add(MKE$(0.12345)) ' the first element be 0.12345
' just append a bunch of new elements:
builder.Add(MKE$(1,2,3,4,5))
' and some more
builder.Add(MKE$(6.666, 7.777))
' now let's read what we have:
' put the virtual array onto the string:
string builderData = builder.ToString()
Redim myNumber(Strptrlen(Strptr(builderData))/SizeOf(Number)) At Strptr(builderData)
' list what we have
For i = 1 to UBound(myNumber)
PrintL i, myNumber(i)
Next
WaitKey
I may add direct pointer to string in stringBuilder as functionality, if there is interest. That would skip the step with assignment to temporary string variable, making it even faster
Petr
Bookmarks