Using Sax ActiveX Scripting (long story), I have 3 nested if statements which reuse the same return variable. Script looks roughly like:
Dim rtnArray As Variant
If variable1 <> "" Then
' Perform SQL query against DB2 database
rtnArray = DB2SQLSearch(Query)
If UBound(rtnArray) = 0 Then
' ditto
rtnArray = DB2SQLSearch(Query2)
MsgBox "Gets this far"
If UBound(rtnArray) = 0 Then ' Error!
' Never make it here
What's odd is that this same code structure is working in a script I wrote last week; I simply changed a couple of the queries and the name of the function (find > replace).
After the 2nd query, I've tried a MsgBox CStr(rtnArray(0)(0))
but it yields Error 10025 in : Array has a different number of indexes.
Error codes correspond to the following manual:
http://www.ftgsoftware.com/manuals/basic32.pdf