CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Dynamic Array

  1. #1
    Guest

    Dynamic Array

    Trying to create a dynamic array that gets resized based on user input and does NOT lose previous data. Think I know how to do this using PRESERVE, but not sure where to place the code. My form contains a label giving instructions, a text box for input and a command button for displaying the contents of the array.

    Any suggestions/help would be appreciated by this beginner.


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Dynamic Array

    in your form module

    option explicit
    dim arr() as string
    dim i as integer
    sub Command1_click()
    redim Preserve arr(i) as string
    arr(i) = valueFromTextBox
    i = i+ 1
    end sub





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

Featured