Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nested try catch
Message
De
28/11/2009 08:47:05
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01436785
Message ID:
01436817
Vues:
100
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
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform