UBound Function

āĻāĻ•āϟāĻŋ āĻ…ā§āϝāĻžāϰ⧇āϰ āωāĻšā§āϚ āϏ⧀āĻŽāĻž āĻĒā§āϰāĻĻāĻžāύ āĻ•āϰ⧇āĨ¤

āϏāĻŋāύāĻŸā§āϝāĻžāĻ•ā§āϏ:


UBound (ArrayName [, Dimension])

āĻĒā§āϰāĻĻāĻžāύ āĻŽāĻžāύ:

Integer

āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāϟāĻžāϰ:

ArrayName: āĻ…ā§āϝāĻžāϰ⧇āϰ āύāĻžāĻŽ āϝāĻžāϰ āϜāĻ¨ā§āϝ āφāĻĒāύāĻŋ āϊāĻ°ā§āĻ§ā§āĻŦ (Ubound) āĻ…āĻĨāĻŦāĻž āύāĻŋāĻŽā§āύ (LBound) āϏ⧀āĻŽāĻžāύāĻž āύāĻŋāĻ°ā§āϧāĻžāϰāĻŖ āĻ•āϰāϤ⧇ āϚāĻžāύāĨ¤

[Dimension]: āχāύāϟāĻŋāϜāĻžāϰ āϝāĻž āϊāĻ°ā§āĻ§ā§āĻŦ (Ubound) āĻ…āĻĨāĻŦāĻž āύāĻŋāĻŽā§āύ (LBound) āϏ⧀āĻŽāĻžāύāĻžāϰ āϜāĻ¨ā§āϝ āϕ⧋āύ āĻŽāĻžāĻ¤ā§āϰāĻž āĻĒā§āϰāĻĻāĻžāύ āĻ•āϰāĻž āĻšāĻŦ⧇ āϤāĻž āωāĻ˛ā§āϞ⧇āĻ– āĻ•āϰ⧇ āĻĨāĻžāϕ⧇āĨ¤ āϝāĻĻāĻŋ āϕ⧋āύ āĻŽāĻžāύ āωāĻ˛ā§āϞ⧇āĻ– āĻ•āϰāĻž āύāĻž āĻĨāĻžāϕ⧇, āϤāĻžāĻšāϞ⧇ āĻĒā§āϰāĻĨāĻŽ āĻŽāĻžāĻ¤ā§āϰāĻž āϏ⧀āĻŽāĻžāύāĻž āĻĒā§āϰāĻĻāĻžāύ āĻ•āϰ⧇ āĻĨāĻžāϕ⧇āĨ¤

Error codes:

5 Invalid procedure call

9 Index out of defined range

āωāĻĻāĻžāĻšāϰāĻŖ:


Sub ExampleUboundLbound
Dim sVar(10 To 20) As String
    Print LBound(sVar())
    Print UBound(sVar())
End Sub
 
Sub ExampleUboundLbound2
Dim sVar(10 To 20,5 To 70) As String
    Print LBound(sVar()) REM Returns 10
    Print UBound(sVar()) REM Returns 20
    Print LBound(sVar(),2) REM Returns 5
    Print UBound(sVar(),2) REM Returns 70
End Sub

Please support us!