eeehm, well I'm new to VBA though not to programming in general. So I was curious about "how can I test if a variable is actually instantiated or not"
(C: if (NULL==pObjInstance){}).
Maybe the following code-fragment demonstrates more detailed what I'm talking 'bout:
==== snip ====
Code:
Option explicit
Dim tm as object
set tm = CreateObject("TextMaker.Application")
tm.Application.Visible = true
' This works well
If tm.Application.Documents.Count>0 then
tm.Application.ActiveDocument.Selection.TypeText "god dag alle sammen"
end if
' This doesn't work and returns with "Error in line: xy - Invalid procedure call or argument"
If not(IsEmpty(tm.Application.ActiveDocument)) then
tm.Application.ActiveDocument.Selection.TypeText "god dag alle sammen"
end if
' And this doesn't work either
If not(IsNull(tm.Application.ActiveDocument)) then
tm.Application.ActiveDocument.Selection.TypeText "god dag alle sammen"
end if
set tm = nothing
==== snap ====
So the question is: How can I test if a variable exists inside VBA/SoftMaker Basic?