B
barcrofter
I have two independent arrays and mysteriously they occupy the same
space. Is this an error or a feature?
Dim tokens$() '(input list of msn's and
constants)
Dim values() As Object '(tokens with msn's replaced by
values)
temp="A = 2 * B"
'---parse the temp expression into tokens
tokens = Split(temp, " ")
'---setup a similar sized values array
ReDim values(UBound(tokens))
values=tokens
and under vb.net changing tokens(4) will now change values(4)!!.
I expected that making values = tokens would give me an array "copy by
element". In fact it made the two occupy the same array space. Is
this a bug or a language feature??
space. Is this an error or a feature?
Dim tokens$() '(input list of msn's and
constants)
Dim values() As Object '(tokens with msn's replaced by
values)
temp="A = 2 * B"
'---parse the temp expression into tokens
tokens = Split(temp, " ")
'---setup a similar sized values array
ReDim values(UBound(tokens))
values=tokens
and under vb.net changing tokens(4) will now change values(4)!!.
I expected that making values = tokens would give me an array "copy by
element". In fact it made the two occupy the same array space. Is
this a bug or a language feature??