Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design question - how to interrupt process
Message
 
 
À
01/06/2005 14:43:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01018971
Message ID:
01019113
Vues:
19
Greg,

In other words, it would not work, then? :(

Here is what I put in Error method:
*---------------------- Location Section ------------------------
*   Library: 	Aqueueprocess.vcx
*   Class: 		Aassignqueues
*   Method: 	Error()
*----------------------- Usage Section --------------------------
*)  Description:
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	06/01/2005 - NN
*		MODIFIED
*----------------------------------------------------------------
lparameters nError, cMethod, nLine
if m.nError <> 1089 && Custom error
	local lcError, lnI, laErrors[1]
	lcError = "Encountered an error #" + transform(m.nError) + " " + ;
		message() + " " + message(1)+ " in method " + m.cMethod + ;
		"on line # " + transform(m.nLine) + chr(13)

	if not inlist(type('gaErrors[1]'),"U", "L")

		for lnI = 1 to alen(gaErrors)
			lcError = m.lcError + transform(gaErrors [m.lnI]) + chr(13)
		next
	endif
	this.lRealError = .t.
	this.cError = m.lcError
endif
and this in cError_Assign:
*---------------------- Location Section ------------------------
*   Library: 	Aqueueprocess.vcx
*   Class: 		Aassignqueues  
*   Method: 	Cerror_assign() 
*----------------------- Usage Section --------------------------
*)  Description: 
*)

*   Scope:      Public
*   Parameters: 
*$  Usage:      
*$              
*   Returns:  
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	06/01/2005 - NN 
*		MODIFIED
*----------------------------------------------------------------
LPARAMETERS vNewVal
*To do: Modify this routine for the Assign method
THIS.cError = m.vNewVal
this.WriteToLogfile(this.cError)
IF NOT this.lRealError
   ERROR this.cError && Trigger an error
endif   
this.lRealError = .f.
Now, you're saying, that it would not work? :(


>I readed the VFP Help file on TRY CATCH, and it states that the ERROR event will catch the objects error before the CATCH statement. In otherwords, if there is a Error event, it will process the error first. I also saw no means to raise the error to the CATCH statement from the Error event. But, if there is no Error event defined in the object, the CATCH statement does process the error.
>
>
>From the Error event help
>Any errors that occur in an object's Error event must be handled by the object and are not escalated to an ON ERROR routine or TRY...CATCH...FINALLY handler.
>

>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform