Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nested try catch
Message
From
28/11/2009 08:47:05
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:
01436817
Views:
97
The error does not throw forward. I would like the completewhere() method to catch the error so I can run the getReqiredParms() method. That is not happening.
>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
>>
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform