Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Try... this.error()... and then catch
Message
De
23/04/2004 18:07:32
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00897769
Message ID:
00897813
Vues:
15
>Dragan,
>
>Maybe I'm missing something but the easiest way to check if collection item exists is to use GetGey method()
>
>
IF This.params.GetKey(cName) = 0
>	oItem=Createobject("empty")
>	AddProperty(oItem,"name", cName)
>	AddProperty(oItem, "value", uValue)
>	This.params.Add(oItem, cName)
>ENDIF
>
>
>>Just observed this behavior. I'm building a collection dynamically (a set of parameter name and value pairs for a view), and since the first time around the member of the collection doesn't exist, the simplest way to check whether it exists is to try...
><snip>

Ya prosto durak. I didn't see that method at all... and I was looking at it. Just didn't RTFM to see that it can work both ways, to return a number from a string key. Hit my blind spot.

Still - I'm puzzled with this behavior of try/catch. Why in the world would some error method interfere with code in try/catch - I was under impression that that no error handling other that what's in the catch block would ever run between try and endtry.

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