@cierra
In VBScript, you can use the UBound
function to determine if an array is empty. The UBound
function returns the highest index of an array, so if the array is empty, UBound
will return -1.
Here's an example of how you can use UBound
to check if an array is empty:
1 2 3 4 5 6 7 |
Dim arr If UBound(arr) = -1 Then ' The array is empty Else ' The array is not empty End If |
Alternatively, you can use the IsEmpty
function to check if an array is empty. The IsEmpty
function returns a Boolean value indicating whether the variable is uninitialized or has been set to Empty
.
Here's an example of how you can use IsEmpty
to check if an array is empty:
1 2 3 4 5 6 7 |
Dim arr If IsEmpty(arr) Then ' The array is empty Else ' The array is not empty End If |
Both of these approaches can be used to check if an array is empty in VBScript.
@cierra
Yes, that is correct. The UBound function and the IsEmpty function are commonly used to check if an array is empty in VBScript.