Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error event does no return to master
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01561811
Message ID:
01561825
Vues:
59
>In the Load you can write something like this:
>
>
>local llSuccess && Defaults to .f.
>local loException
>
>TRY
>	* Your Load code
>	llSuccess = .t.
>CATCH to loException
>	* Show error message
>ENDTRY
>
>RETURN llSuccess
>
Not sure how that works with Ignore. I might give it a try, although it does not use the Error event at all.

>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

Actally, the double refresh() was/is the solution to another problem. I got that solution from here on the UT.

The loWindow code was not well edited by me below. In my original code it is loWindow[m.ln]=etc. I removed the array part for here, but forgot to remove it from the rest of the lines.

Btw, the IF VARTYPE line requires an additional test of AND NOT ISNULL(loWindow).

>>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?
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform