Le 12 févr. 07 à 17:40 Soir, Robert Woodhead a écrit:
I have a question about how arrays that are redimensioned are
initialized.
Let's say I've got an array in an class that's defined as:
Derf(-1) as Integer = 1
and sometime later, I redim it
redim Derf(100)
Are the new elements set to 1? Cleared to 0 (default for
integers)? Or have undefined values?
They are set to 0.
They should not be set to 1: that would mean values are somehow
linked together with the first one (that's bad).
Also, in RB, there's no undefined value because memory is cleaned.
I took a quick look through the documentation and cannot find this
addressed anywhere.
Just make a blank project and write:
dim i(3) As Integer
i(0)=2
i(1)=4
i(2)=6
i(3)=8
Redim i(2)
Redim i(6)
Break
in the mouse down event; no need for documentation
;-)_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>