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.comICQ #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.