Results 1 to 3 of 3

Thread: very important

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    1

    Exclamation very important

    -Hello
    -I want to summarize this code because it is too long:

    Dim Ad2 As Object
    Dim Ad3 As Object
    Dim Ad4 As Object
    Dim Ad5 As Object
    Dim Ad6 As Object
    Dim Ad7 As Object
    Dim Ad8 As Object
    Dim Ad9 As Object...

    -To: Dim Ad268 As Object . Tanks!..

  2. #2
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,894

    Re: very important

    This shouldn't be posted to the Codebank section, but you are looking for either an array or a Collection.

    Array version:

    Code:
    Dim Ad(2 To 268) As Object
    You can then refer to items in the array as follows:

    Code:
    Ad(2).SomeProperty = "Some Value"
    Or you can create a Collection object and add as many other objects to it as you like.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: very important

    Welcome to VBForums

    Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'VB6 and earlier' forum

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