Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimization on one line
Message
De
12/07/2001 22:23:08
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00530057
Message ID:
00530078
Vues:
16
>>>>>In my quest of optimizing my code, how about this one:
>>>>>
>>>>>
>>>>>lcField=FIELD(lnCompteur)
>>>>>IF &lcField<>OLDVAL(FIELD(lnCompteur))
>>>>>
>>>>
>>>>So. . .
>>>>IF FIELD(lnCompteur) <> OLDVAL(FIELD(lnCompteur))
>>>>. . . doesn't work?
>>>It wouldn't work because FIELD(lnCompteur) returns the name of the field not it's value. The following will work
IF EVAL(FIELD(lnCompteur)) <> OLDVAL(FIELD(lnCompteur))
>>
>>Of course. . . stupid me.
>>
>>But I don't think the EVAL is needed. Simply (FIELD(lnCompteur)) works on my system (tried it THIS time < s >)
>
>It doesn't work on mine. It still the field name not a value.

You're right! My 'test' was invalid!
Time to go to bed!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform