P
plau011
Hi all,
I thought I understood .Net Framework with value types and
referencetypes but apparently not.
So I have this code. Excuse me if it's not 100% correct I cut and paste
and shortened it a bit to make things clearer
So basically the purpose of this code was to have to arrays passed in
byref _BInfo
and CInfo.
Then base on another list of items that gets passed through is to fill
one or the other.
I was wanting to use a array of objects pointer to "point" to BInfo or
CInfo Array
'Dim BInfo(,) As Object 'passed in byref
'Dim CInfo(,) As Object 'passed in byref
' Dim Mycoll as collection
Dim NodetoSet(,) As Object
Dim UpperBound As Integer
For Each X in Coll Loop ' Not important
If X.UseB Then
ReDim BINFO(30, UBound(BInfo) + 1)
NodetoSet = BINFO ' What is this doing. Is it
copying data from BINFO to NodetoSet why? Shouldn't it treat as a
pointer??
Else
ReDim CInfo(30, UBound(CInfo) + 1)
NodetoSet = CInfo ' What is this doing. Is it
copying data from BINFO to NodetoSet why? Shouldn't it treat as a
pointer??
End If
UpperBound = UBound(NodetoSet, 2) - 1
'doing stuff with NodeToSet
NodeToSet(UpperBound,1) = "hello"
NodeToSet(UpperBound,1) = "goodbye" 'And so on....
Next
Thanks in advance
I thought I understood .Net Framework with value types and
referencetypes but apparently not.
So I have this code. Excuse me if it's not 100% correct I cut and paste
and shortened it a bit to make things clearer
So basically the purpose of this code was to have to arrays passed in
byref _BInfo
and CInfo.
Then base on another list of items that gets passed through is to fill
one or the other.
I was wanting to use a array of objects pointer to "point" to BInfo or
CInfo Array
'Dim BInfo(,) As Object 'passed in byref
'Dim CInfo(,) As Object 'passed in byref
' Dim Mycoll as collection
Dim NodetoSet(,) As Object
Dim UpperBound As Integer
For Each X in Coll Loop ' Not important
If X.UseB Then
ReDim BINFO(30, UBound(BInfo) + 1)
NodetoSet = BINFO ' What is this doing. Is it
copying data from BINFO to NodetoSet why? Shouldn't it treat as a
pointer??
Else
ReDim CInfo(30, UBound(CInfo) + 1)
NodetoSet = CInfo ' What is this doing. Is it
copying data from BINFO to NodetoSet why? Shouldn't it treat as a
pointer??
End If
UpperBound = UBound(NodetoSet, 2) - 1
'doing stuff with NodeToSet
NodeToSet(UpperBound,1) = "hello"
NodeToSet(UpperBound,1) = "goodbye" 'And so on....
Next
Thanks in advance