In the Load you can write something like this:
local llSuccess
local loException
TRY
llSuccess = .t.
CATCH to loException
ENDTRY
RETURN llSuccess
And your code to call it:
loWindow = newobject( 'viafrm_viajob', 'viajob.vcx' )
if vartype(loWindow) = 'O'
loWindow.refresh()
loWindow.show()
loWindow.refresh()
read events
endif
[Update]
Removed the array reference to loWindow as I do not understand why you used it, and not sure why you call refresh() twice
>Hi All,
>
>I instantiate a form:
>
>
glFormInitOK = .T.
>loWindow = newobject( 'viafrm_viajob', 'viajob.vcx' )
>if m.glFormInitOK
> loWindow[ m.ln ].refresh()
> loWindow[ m.ln ].show()
> loWindow[ m.ln ].refresh()
> read events
>endif
>
>To test my error handling I have created an erroneous line in the LOAD that will invoke the Error Event. I offer the user the option to retry, ignore or abort. When abort is chosen I set m.glFormInitOK to False and try RETURN TO MASTER.
>
>However, after execution of the RETURN TO MASTER command it continues with the code in the Init method of at least several objects, causing additional errors handled by the same Error Event. Only after several of those additional handliings it quits the form instantiation phase.
>
>I have tried several alternative commands to end the creation of the form. None appears to prevent the execution of the code in the Init methods.
>
>I try to avoid using ExitProcess().
>
>What am I doing wrong?
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges