csharp_learner
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
Dim a(0 To 2)
All arrays in VBScript have a lower bound of zero.
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
~bp
ASKER