+ Reply to Thread
Results 1 to 3 of 3

Variant

  1. #1
    Registered User
    Join Date
    03-10-2005
    Posts
    46

    Variant

    Hi,
    could you please let me know what the following means?
    Dim szWarData() As Variant

    ReDim szWarData(ntRow + 1, 10)

    What does Variant mean?

    Please let me know. Thanks.

  2. #2
    JakeyC
    Guest

    Re: Variant

    A 'Variant' is a type of variable declaration just like 'Integer' or
    'String'. The difference is that a variant may store data of an
    unspecified format i.e. not just whole numbers or not just a block of
    text.


  3. #3
    baj
    Guest

    Re: Variant

    In fact you can't compare a Variant just with an Integer or a String...

    OK, it stands also for a specific type, the "Variant"-type but that's
    just the thing : if you don't know exactly what type you need you can
    just take the Variant as a black box... the Variant has a big fitt for
    all kinds of variables, but at the same time you have to be carefull
    with it...

    In your example : Dim szWarData() As Variant
    szWarData() is in fact the definition of a dynamic array (meaning it's
    not fixed, it can be changed) of the Variant type (note: if you don't
    define the type exactly, the system assumes it's a Variant-type)

    Now in you next statement : ReDim szWarData(ntRow + 1, 10)
    you give the variable szWarData the dimensions ntRow+1 and 10...

    To learn more about this you should look into the subjects : Arrays,
    Dynamic Arrays, Redim, Erase, UBound and LBound...

    Good Luck


+ 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