Post

 Resources 

Console


VB does have pointers... MetalWarrior (0 replies, 0 views) (2001-Feb-23)
-
You can do pointers, and linked lists in VB, just not quite as nicely as in C++. The easiest way to use pointers is with classes. Just dim anything As MyClass and you have a pointer to a class. For instance, say you have a class named Class1. Dim Pointer1 As Class1 Dim Pointer2 As Class1 Set Pointer1 = New Class Set Pointer2 = Pointer1 Now you have two pointers of one instance of Class1 - NOT two separate classes. You can also emulate pointers with UDTs and arrays... Type MyType Value As Integer NextPointer As Integer PrevPointer As Integer End Type Dim MyArray() As MyType This can be used as a linked list, like so: NextLink = MyArray(CurrentLink).NextPointer NextValue = MyArray(NextLink).Value Get it?


-
Up One Level | Back to Forum


Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 75 visitors within the last 20 minutes
RSS News Feed