+ Reply to Thread
Results 1 to 2 of 2

Array questions

  1. #1
    Perico
    Guest

    Array questions

    When you assign values in a range to a variant, I read that the indexes are
    always one-based, even if Option Base 0 is explicitly declared.

    Example:
    Option Base 0
    Dim SalesData
    SalesData=Range("A1:F10000")
    Customer = SalesData


    Would that apply if the coder did this, using the "()", a dynamic array of
    variants?:
    Option Base 0
    Dim SalesData()
    SalesData()=Range("A1:F10000")
    Customer = SalesData()

    I'm also curious, does the code, "Customer = SalesData", assign the same
    value as would "Customer = SalesData()"?


    I ask because I'm working on some code where the Devleoper wrote code and
    I'm trying to figure out whether declaring Option Base would have any impact:

    Dim varAddr()
    varAddr() = Range("h2:h65536")


  2. #2
    Alan Beban
    Guest

    Re: Array questions

    Perico wrote:
    > When you assign values in a range to a variant, I read that the indexes are
    > always one-based, even if Option Base 0 is explicitly declared.
    >
    > Example:
    > Option Base 0
    > Dim SalesData
    > SalesData=Range("A1:F10000")
    > Customer = SalesData
    >
    >
    > Would that apply if the coder did this, using the "()", a dynamic array of
    > variants?:
    > Option Base 0
    > Dim SalesData()
    > SalesData()=Range("A1:F10000")
    > Customer = SalesData()


    What happened when you tried it?
    >
    > I'm also curious, does the code, "Customer = SalesData", assign the same
    > value as would "Customer = SalesData()"?


    What happened when you tried it?

    Alan Beban

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1