This is what I've done so far:
in declarations:
private type MyType variable1 as integer variable2 as string end type private arrayOfTypes() as MyType
then in the code:
if ubound(arrayOfTypes)=0 then redim arrayOfTypes(1) else redim arrayOfTypes(ubound(arrayOfTypes)+1) end if
But it throws "subscript out of range" when the array is not initialised, because just erased by another function or it is the first use
Since I have no clue on how to check if the array is valid, because if I try to catch "null" and "nothing" with
if arrayOfTypes is nothing then dosomething() 'or if arrayOfTypes(0).variable1 is null then dosomething() 'and other similar testsit give another error like "Type mismatch" and I can't safely use the array because I can't always redim without knowing the exact length
I have some ideas which make use of the on error goto label and on error resume next, but I'm trying to avoid spaghetti code since I already have an error handling goto on all functions
so I ask your help to get rid of this problem

New Topic/Question
Reply



MultiQuote



|