Hello,
I'm working on a form which has multiple variables passed to it via OpenArgs with a pipe (|) separating each variable.
My code captures the string and creates an array containing each element and this works just fine.
However.
This particular form can be opened from multiple different locations each of which passes a different number of variables to the form. For example one form passes 2, another form passes 3.
Each array element is assigned to a string variable, but when I try and assign the third string variable, if there is no third element in the array I receive an error message about the subscript being out of range.
How do I actually check that an array element exists before assigning it to a variable?
I've tried:
If myArray(2) = ""
etc...
If IsNull myArray(2)
etc...
If myArray(2) IS NOTHING
etc...
But none of them seem to work
I'm working on a form which has multiple variables passed to it via OpenArgs with a pipe (|) separating each variable.
My code captures the string and creates an array containing each element and this works just fine.
However.
This particular form can be opened from multiple different locations each of which passes a different number of variables to the form. For example one form passes 2, another form passes 3.
Each array element is assigned to a string variable, but when I try and assign the third string variable, if there is no third element in the array I receive an error message about the subscript being out of range.
How do I actually check that an array element exists before assigning it to a variable?
I've tried:
If myArray(2) = ""
etc...
If IsNull myArray(2)
etc...
If myArray(2) IS NOTHING
etc...
But none of them seem to work