Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question in error handling
Message
From
04/08/2004 04:28:51
 
 
To
03/08/2004 16:06:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00930495
Message ID:
00930577
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform