Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21256

VB6 - Convert Variant to Node

$
0
0
I am using a For Each loop to go through a Variant array in VB6. At one point, I want to convert the element of the loop (elem), which is a Variant, to a Node.

Code:

Dim elem as Variant

For Each elem In ndArray
    Dim nodle As Node
    nodle = CType(elem, Node)
Next

That's not the whole loop, but it gives you an idea of what I'm trying to do. When I run this code, I get an error saying "Variable not defined", which points to the 'Node' in the CType method. This is not a variable, it is a type and the method should know that since it is expecting a type.

Anyone know what's going on here? Is this conversion even possible?

Any suggestions would be greatly appreciated.

Viewing all articles
Browse latest Browse all 21256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>