VBScript » Functions » LBound

Version: 1.0

Syntax:
LBound(ArrayName, Dimension)
ArrayName
The ArrayName argument is the name of the array. Do not include the parenthesis with the array name.
Dimension
The optional Dimension argument is used to identify which index you are determining the lower bounds for in a multi-dimensional array.

The LBound function returns the lower limit for the elements in an array.

By default, in the current versions of VBScript, the LBound function always returns a zero.

Examples

Code:
<% Dim catarray(3) %>
<% catarray(0) = "Mountain lion" %>
<% catarray(1) = "Bobcat" %>
<% catarray(2) = "Jaguar" %>
<% =LBound(catarray) %>
Output:
0
Language(s): VBScript
Code:
<% Dim fisharray(2,3) %>
<% fisharray(0,0) = "Neon tetra" %>
<% fisharray(0,1) = "Angle fish" %>
<% fisharray(0,2) = "Discus" %>
<% fisharray(1,0) = "Golden dojo" %>
<% fisharray(1,1) = "Clown loach" %>
<% fisharray(1,2) = "Betta" %>
<% =LBound(fisharray, 2) %>
Output:
0
Language(s): VBScript

See Also: