Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When for custom Controls
Message
From
20/12/2001 06:58:36
 
 
To
20/12/2001 06:48:58
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00596595
Message ID:
00596665
Views:
34
Hi!

When we allow to run custom code, we should predict developer's errors in case somebody mistakenly return other value from When method. So we just use Empty() function to avoid any error inside of the generic class code.

I agree that this could be re-writted to the simple line of code. But I tried to make sample as cleara s possible, and also some custom logic could be added for different cases when needed without much changes (that could be a case for such kind of classes). I agree that my splitting to "if" statement is the same as statement like below
if MyVar>20
 llExternal=.T.
else
 llExternal=.F.
endif
Is that what you meant? {g} ;))


>>if empty(this.When())
>> this.SetAll('Enabled',.F.)
>>else
>> this.SetAll('Enabled',.T.)
>>endif
>
>I believe the above can be simplified to:
>
>
>This.SetAll('Enabled', This.When())
>
>
>since This.When() returns a logical value.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform