Link to home
Start Free TrialLog in
Avatar of csharp_learner
csharp_learnerFlag for Singapore

asked on

Option Base Declaring arrays with lower bound <> 0

Hi,

Option Base Declaring arrays with lower bound <> 0 is not in VB script only in VBA.

What does this mean and can any experts provide an example on this?
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of csharp_learner

ASKER

so meaning Option Base Declaring arrays with lower bound <> 0 means that in only VB script, you can set the start of the array?
As you say, there is no Option Base statement in VBScript. Nor can you explicitly set the lower bound value. This works in VBA, but not in VBScript:

Dim a(0 To 2)

All arrays in VBScript have a lower bound of zero.


Avatar of Bill Prew
Bill Prew

It is true that all arrays have a lower bound of 0 in VBS, no way around that.  This always puzzled me since they chose to include the LBound() function, even though it will always return 0.  I guess just for code compatibility.

~bp