Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Try... this.error()... and then catch
Message
De
23/04/2004 21:13:00
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00897769
Message ID:
00897843
Vues:
18
>Dragan,
>
>Can you put together a small repro code that shows the problem?

Here it is, as simplified as can. Both classes (caller and the one with a collection) have their own error methods. First time I had this (earlier this afternoon), the caller's error code was executing; now with this example it's the method of the class where it happens - don't know what caused the difference. Still, it happens in try block, which I think shouldn't happen.
ox=CreateObject("Testcaller")

Define Class testcaller As Custom

	Procedure Init
		This.AddObject("member","hasACollection")
		this.member.setparams("Parametername","SomeValue")
	Endproc

	Procedure Error(nError, cMethod, nLine)
		Messagebox(Program())
	Endproc

Enddefine


Define Class HasACollection As Custom
	Add Object params As Collection

	Procedure Error(nError, cMethod, nLine)
		Messagebox(Program())
	Endproc

	Procedure SetParams(cName, uValue)
		Try
			oItem=This.params.Item(cName)
			oItem.Value=uValue
		Catch To oExc
			oItem=Createobject("empty")
			AddProperty(oItem,"name", cName)
			AddProperty(oItem, "value", uValue)
			This.params.Add(oItem, cName)
		Endtry
	Endproc
Enddefine

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform