Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When for custom Controls
Message
 
 
À
20/12/2001 06:48:58
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00596595
Message ID:
00596665
Vues:
35
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform