Option Base Bug? 
Author Message
 Option Base Bug?

I have two custom defined types:

Option Base 1

Syntax One:
    type xyz
        token as string * 2
        gData(6) as single
    end type

Syntax Two:
    type xyz
        token as string * 2
        gData(1 to 6) as single
    end type

I would expect both syntax one and two to behave identically since option base is set to 1. But when you trace thru the code, the option base for syntax one starts at 0, not 1. Is this a known bug?

Thanks.

Marc



Fri, 10 Sep 2004 07:30:10 GMT  
 Option Base Bug?
Please post in text format rather than HTML.  Not everybody uses a
newsreader that supports HTML.

I don't think this is a bug, but I can't find documentation of this behavior
either.  I'd surmise that Option Base only affects declared variable arrays
and not arrays used as a member of a UDT.  If .NET is anwhere in your near
future, you're better of using a 0-based array anyway because that's all
.NET allows.

Mike


I have two custom defined types:

Option Base 1

Syntax One:
    type xyz
        token as string * 2
        gData(6) as single
    end type

Syntax Two:
    type xyz
        token as string * 2
        gData(1 to 6) as single
    end type

I would expect both syntax one and two to behave identically since option
base is set to 1. But when you trace thru the code, the option base for
syntax one starts at 0, not 1. Is this a known bug?

Thanks.

Marc



Fri, 10 Sep 2004 08:23:25 GMT  
 Option Base Bug?
Thanks Mike...I found this in the MS support knowledgebase. No explanation
to why its not supported. Yes, I usually use 0 based anyways, but one of our
business users discovered this issue.

Type Statement Clarification

The last sentence of the "Type statement" Help topic states: "The setting of
the Option Base statement determines the lower bound for arrays." This
sentence is incorrect and should be ignored. The Option Base setting has no
effect on arrays in user-defined types.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q170161


Quote:
> Please post in text format rather than HTML.  Not everybody uses a
> newsreader that supports HTML.

> I don't think this is a bug, but I can't find documentation of this
behavior
> either.  I'd surmise that Option Base only affects declared variable
arrays
> and not arrays used as a member of a UDT.  If .NET is anwhere in your near
> future, you're better of using a 0-based array anyway because that's all
> .NET allows.

> Mike



> I have two custom defined types:

> Option Base 1

> Syntax One:
>     type xyz
>         token as string * 2
>         gData(6) as single
>     end type

> Syntax Two:
>     type xyz
>         token as string * 2
>         gData(1 to 6) as single
>     end type

> I would expect both syntax one and two to behave identically since option
> base is set to 1. But when you trace thru the code, the option base for
> syntax one starts at 0, not 1. Is this a known bug?

> Thanks.

> Marc



Fri, 10 Sep 2004 08:54:00 GMT  
 Option Base Bug?

Quote:

> I have two custom defined types:
> Option Base 1
> Syntax One:
>     type xyz
>         token as string * 2
>         gData(6) as single
>     end type
> Syntax Two:
>     type xyz
>         token as string * 2
>         gData(1 to 6) as single
>     end type
> I would expect both syntax one and two to behave identically since option
> base is set to 1. But when you trace thru the code, the option base for
> syntax one starts at 0, not 1. Is this a known bug?

It's a bug, but not one that should matter, since best practice says
to always explicitly specify the lower bound anyway, if possible.
(Overzealous Evangelists.NET attempting to mislead people excepted)

--
Joe Foster <mailto:jlfoster%40znet.com>     Got Thetans? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 10 Sep 2004 11:44:49 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Mixing Option Base

2. Need Help Editing a Document Based on Dialog Box Options

3. Word 2000 No Option Base 1 in Forms

4. Option Base 1 problem with control array.

5. Option Base

6. Split & Option Base interaction

7. option base question

8. Option Base 1 under VB 4.0a

9. modifying form options in one field based on another

10. Option base problem

11. <option Selected> based on variable

12. Question on Option Base 1 and Type/End Type

 

 
Powered by phpBB® Forum Software