General information
Category:
Coding, syntax & commands
Title:
In VFP can i use On error goto Errorhandler like VB
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****************************
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only