Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing Form Object - Best Practices
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00865496
Message ID:
00866082
Views:
20
>>>>>>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,

Just a thought. Would this technique work for all objects? What about the empty object? I haven't tested this that's why I ask.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform