Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
In VFP can i use On error goto Errorhandler like VB
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00790450
Message ID:
00790466
Vues:
20
>Can i use like VB on error goto mapierror in VFP
>The following Please:
>********************Start******************
>On Error GoTo mapiError
>
>WAIT WINDOW NOWAIT "Please wait ... Logging Into Mail" NOCLEAR
>
>WITH thisformset.basicform1
> PUBLIC array ErrorArray(1)
> &&PUBLIC mapierror
> local lcCRLF
> * Define constant
>*#DEFINE CRLF CHR(13) + CHR(10)
>*or define variable
>lcCRLF = CHR(13) + CHR(10)
>
> IF NOT .oleSession.SessionID > 0
> .oleSession.Signon
> ENDIF
>
>* If the session ID is not valid, do not allow the form to load
> IF .oleSession.SessionID > 0
> WAIT clear
> .oleMessage.SessionID = .oleSession.SessionID
>* Start a new message
> mRev_Com = sub_revw.comment
> .oleMessage.Compose
> .oleMessage.RecipIndex = 0
> .oleMessage.AddressResolveUI = .T.
> .oleMessage.RecipDisplayName = ALLTRIM(sub_revw.reviewer)
> .oleMessage.ResolveName
> ELSE
> WAIT WINDOW "Form Cannot Load: Login Failed"
> ENDIF
>mapiError:
> aError(ErrorArray)
> IF ErrorArray(1,1) = 1429 && mapi error
> MapiError = ErrorArray(1,6)
> ELSE
> MESSAGEBOX("ERROR HAS OCCURED "+ MESSAGE())
> ENDIF
> RETURN
>
>*************************END****************************

No you can't. ON ERROR DO ERR_HANDLER.PRG WITH... is about as close as you'll get. You might want to note, however, that in .NET (like VFP 8.0) you can use TRY...CATCH structured error handling.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform