Results 1 to 3 of 3

Thread: Using an array

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    Hi,

    I have this code:

    Private bConnected(MAX_USERS) as boolean

    I want to be able to set what MAX_USERS is at runtime so i can set the number of items in the array is, but vb says it must be a const which, (i think) cannot be chaged at runtime i.e. 'const-ant'.

    Is there a way to do this ?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try:
    Code:
    Private bConnected() As Boolean
    
    Redim bConnected(MAX_USERS)
    Use Preserve in there to keep the current contents.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    Thanks for the quick response

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