Defining an array

Results 1 to 4 of 4

Thread: Defining an array

  1. #1
    Mr Clean Guest

    Default Defining an array

    Hello to all<BR><BR>I build a banner system that collects info fron database, then according to that info, an array is built. For example if 2 records in the database represents banners while one has an exposure value of 60 percent and the other has an exposure value of 40 percent then an array of 100 items is created. 60 of then represent the first banner and 40 represent the second banner. Then one is randomly chosen and its image value is displayed (i knoe I could have used the add rotator comp to do the same but I wanted more flexibility in gathering user hits information)<BR><BR>anyway, at the end I create an array with 2 dimentions and 100 items within. <BR><BR>My question is: <BR>I use the following:<BR>Dim BannerArray(100,1)<BR><BR>to declare the array but i dont really want to use 100 as a number. I tried using a variable instead of a number for example:<BR><BR>thisNum = 120<BR>Dim BannerArray(thisNum,1)<BR><BR>but it returnes an error. Is it possible to use a variable to declare the number of items in an array. Thought id run it with some other devs before giving up<BR><BR>thank you for a quick response<BR>cheers<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Defining an array

    This would probably work:<BR><BR>Dim BannerArray()<BR>thisNum = 120<BR>ReDim BannerArray(thisNum,1)<BR><BR>

  3. #3
    Mr Clean Guest

    Default RE: Defining an array

    It does,<BR><BR>THanx a bunch

  4. #4
    Mr Clean Guest

    Default RE: Defining an array

    It does,<BR><BR>THanx a bunch

Posting Permissions

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