Results 1 to 2 of 2

Thread: array of structures (resolved)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Posts
    149

    array of structures (resolved)

    I have an array of type record and was wondering how i insert and item into it. My book doesnt have notation for how to do it.
    Last edited by abcdefg; Nov 2nd, 2003 at 09:25 PM.

  2. #2
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    VB Code:
    1. Private Sub Sample()
    2.  
    3. Dim recArray() as Record
    4. Dim NewRec as Record
    5.  
    6. 'assume recArray is filled here
    7. 'assume newRec is filled here
    8.  
    9. 'now lets redim the array
    10.  
    11. Redim Preserve recArray(Ubound(recArray) +1) ' add one new record
    12.  
    13. recArray(Ubound(recArray)) = newRec
    14.  
    15. End Sub
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

Posting Permissions

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



Click Here to Expand Forum to Full Width