Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question in error handling
Message
De
04/08/2004 04:28:51
 
 
À
03/08/2004 16:06:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00930495
Message ID:
00930577
Vues:
16
This message has been marked as the solution to the initial question of the thread.

Hi all,

Can I throw the same error to a try block from an Error method?


Yes
CLEAR
gMode = 1 && global mode variable (public)
try
  oFrm = createobject('frm')
  oFrm.SomeProcess()
catch to loExc
	? "GLOBAL",loExc.ErrorNo,loExc.Message
finally
endtry

define class frm as form
  proc someprocess()
    error 1
  ENDPROC
  
  proc error(nError, cMethod, nLine)
    if m.gMode = 1
	* I want to throw the error here. Is it possible?
        * error nError && does not do it because the err.lineno, err.proc will be changed.
      	TRY
	    ERROR M.nError
	ENDTRY
    else
      do errhand with nError, cMethod, nLine
    endif
  endproc
enddefine
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform