Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional Best Practice
Message
De
26/07/2001 11:08:49
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
26/07/2001 11:00:42
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00535738
Message ID:
00535752
Vues:
17
This message has been marked as a message which has helped to the initial question of the thread.
First of all, "if PemStatus(...) = .F." can be replaced with "if not PemStatus(...)".

Another alternative, that uses less space (but many will argue it is also less readable):
iif(not PemStatus(...), This.Cbo_TypeDesc.mInitSQL(), "")
iif(not PemStatus(...), This.Cbo_MFSystem.mInitSQL(), "")
etc.
IOW, each if ... endif loop can be compressed into a single line!

Hilmar.


>Often I code with logic like the following:
>
>
>If PemStatus(This.cbo_TypeDesc,'cSourceAlias',5) = .F.
>   This.cbo_TypeDesc.mInitSQL
>Endif
>If PemStatus(This.cbo_MFSystem,'.cSourceAlias',5) = .F.
>   This.cbo_MFSystem.mInitSQL
>Endif
>If PemStatus(This.cbo_Code,'cSourceAlias',5) = .F.
>   This.cbo_Code.mInitSQL
>Endif
>If PemStatus(This.cbo_FullDesc,'cSourceAlias',5) = .F.
>   This.cbo_FullDesc.mInitSQL
>Endif
>
>
>It seems redundant. Is there a better way? Thanks!
>
>Regards, Renoir
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform