Linked Lists

Results 1 to 2 of 2

Thread: Linked Lists

  1. #1
    Join Date
    Dec 1969

    Default Linked Lists

    Hi Guys,<BR><BR>I have come across a small dilema!<BR><BR>I want to create a list of objects in Visual Basic, the objects are a combination of strings and integers. I have used the &#039;Type&#039; Keyword to create a user-defined data structure to hold these values. I am having trouble trying to create a dynamically linked list of many of these structures.<BR><BR>I do not want to use an array mainly because of memory waistage. I&#039;d have to declaire about 1000 items in the array but I may only need 2 or 3.<BR><BR>If anyone knows how to create a self-referencial data structure in Visual Basic similar to the &#039;struct&#039; data type in C/C++ or some other way of creating a linked list please help me out.<BR><BR>Thanx for any help.<BR><BR>Jarvis

  2. #2
    Join Date
    Dec 1969

    Default VB Types are C++ structs

    The difference you want for a linked list won&#039;t really apply... you can&#039;t point to the memory address of your next UDT.<BR><BR>In C++, you would<BR><BR>pointerToStruct-&#062;WhereMyAddressIs-&#062;NextField<BR><BR>etc<BR><BR>You may want to look into VB&#039;s AddressOf(), and see if you can store a pointer in there... I&#039;ve never used it personally, so I can&#039;t tell ya if it will work.<BR><BR>Otherwise, stick with the array. You won&#039;t be wasting that much memory, esp not enough to be concerned about with only 1000 items.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts