Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CATCH TO this.Something
Message
 
À
27/06/2003 09:27:33
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00804645
Message ID:
00805083
Vues:
27
Hi Matthias !

It seems that you fooled VFP by making three things (in "catch to" line)
1) you used property instead of memory variable
2) you used property that not exists
3) you named this property as "exception" - a VFP reserved word
Try to use "catch to this.oException" and VFP behavior will be more understandable



>Hello,
>
>I implemented some methods using try/catch-errorhandling and see odd behavior : if I CATCH TO this.oException in different methods, which call each other I see a TRY/CATCH/ENDTRY-error. If I CATCH TO somevar, no error occurs. Calling each method for itself doesn't generate an error too. Is this intended behavior or is there a reason for that ?
>
>TIA
>Matthias
>
>
>o = CREATEOBJ('Test')
>o.CallWithError() && Error
>o.CallWithOutError() && Success
>o.Method1() && Success
>o.Method2() && Success
>
>DEFINE CLASS Test AS Custom
>Exception = .NULL.
>
>PROCEDURE CallWithError
> TRY
> this.Method1()
> CATCH TO this.Exception
> ENDTRY
>ENDPROC
>
>PROCEDURE CallWithoutError
> TRY
> this.Method2()
> CATCH TO loLocalExc
> ENDTRY
>ENDPROC
>
>PROCEDURE Method1
> TRY
> bahamas
> CATCH TO this.Exception
> ENDTRY
>ENDPROC
>
>PROCEDURE Method2
> TRY
> Hawaii
> CATCH TO loLocalExc
> ENDTRY
>ENDPROC
>
>ENDDEFINE
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform