All Forums >> [Scripting] >> WSH & Client Side VBScript >> howto check if dynamic array is empty Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Dim-ing a variable with () indicates an array of fixed dimensions/size(s). Empty brackets make no sense; if you want a fixed array, you want some number(s) between them.
Use Dim <VarName> or (better) Dim <VarName> : <VarName> = Array() to declare/define/initialize an empty dynamic array. The UBound for an empty array will be -1 (not 0 as your code assumes).