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:
00790468
Vues:
22
You can use

ON ERROR do mapiError

*** mapierror.prg (or procedure in procedure file
your error code here
***

if that is what you mean. You could also use the Error() method in the class or form, If is VFP 8, you could use TRY... CATCH



>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****************************
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform