Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing Form Object - Best Practices
Message
De
12/01/2004 19:30:26
 
 
À
12/01/2004 13:35:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00865496
Message ID:
00866209
Vues:
20
I agree, however, probably due to poor programming, but I've been bitten by that one too. I'm pretty sure I received "property NAME not found" (or perhaps it was refresh?)at times so I've stuck with checking for ISNULL and TYPE O.

>>>>>>It really depends on whether or not you're returning a value, or retrieving a value from the form. Then, you really need to check its state.
>>>>>>
>>>>>>BTW, I don't think that the first line in the IF statement ever will ever evaluate to anything other than null. You need to re-write it to something like
IF UPPER(TYPE('oe_custcv'))="O" .AND. NOT ISNULL(Oe_custcv)
>>>>>
>>>>>FWIW, there is also no need to check with ISNULL(). I the form is not an Object type, then TYPE function returns "U". If the return value is "O", then ISNULL will always be false.
>>>>
>>>>Mark,
>>>>
>>>>Assume something along the lines of the following:
DO FORM myform NAME ofoo LINKED
>>>>oFoo.Release
Now at this point
? TYPE('oFoo') && Returns "O"
>>>>? ISNULL(oFoo) && Returns .T.
>>>>? VARTYPE(oFoo) && Returns "X"
This means that if you're going to use the TYPE() function, then you need to check to make sure that the object isn't null using AND NOT ISNULL().
>>>
>>>Not that it is directly related, but here is also some funny twist with ISNULL()
>>>:)
>>>Re: Does form exists? Thread #394154 Message #394298
>>
>>Thanks, Nick< s >
>
>A single line test can be accomplished with:
>
>if type("oFoo.name") = 'C'
>  ? "Got an object"
>endif
>
>
>Glenn
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform