>Is there a way to check to see if a variable exists or not. For instance, if var1 exists, do whatever, but if not, declare it and then do it.
>
IF Vartype(var1) $ 'UX' && U = undefined, X is defined but NULL
>Same question goes for arrays and objects. If form exists, do something... if not, do something else or create it.
IF TYPE('Var1[1]') # 'U' && Array exists
IF VARTYPE(oObjRef) = 'O' AND NOT ISNULL(oObjecRef) && object exists
Forms are a bit different; in general, it's best to spin through the _Screen.Forms collection trying to find your form, since there may not be a usable independent object reference in scope for a form even when the form is there; the _Screen.Forms collection has a member for each Form presently instantiated, even if no other variable that refers to the Form is presently in scope and addressible.