Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nested try catch
Message
 
 
To
27/11/2009 18:10:28
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01436785
Message ID:
01436798
Views:
90
What seems to be a problem?
>
>I am trying to get a nested try catch to work using throw with little success. I am trying to get the retParm() method to throw an error and have the completewhere() method catch the error. Is this possible?
>
>Thanks.
>
>Here is the code
>
>	FUNCTION completewhere()
>		LOCAL llRet 
>		llRet = .t.
>		TRY 
>			this.oparm = this.oParmObj.retparm()
>		CATCH TO loError 
>                      * catch the error here and run the method below.
>			this.getReqiredParms()
>		FINALLY 		
>			this.oParmObj.removeall()
>		ENDTRY 
>		return llRet 
>	ENDFUNC
>
>	FUNCTION retParm()
>		LOCAL loRet , loError
>		loRet = CREATEOBJECT("empty")
>		TRY 
>			FOR lnx = 1 TO this.count 
>				ADDPROPERTY(loRet,this.aitems[lnx,2],this.aitems[lnx,1])
>			NEXT 
>		CATCH TO loError 
>                      * error occurs and throw the error to  completewhere()
>			THROW loError
>		FINALLY
>
>		ENDTRY
>		return loRet 
>	ENDFUNC
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform