Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When to use parenthases after commands?
Message
De
15/08/2006 18:41:04
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
15/08/2006 17:47:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01145740
Message ID:
01145828
Vues:
21
Hey Craig

>I can see that, but there is also an old rule, "One command per line". You can argue that STORE is one command, but I can also argue that assigning a value to more than one variable at a time is multiple commands. In this case, it's a matter of preference.

Right off. I'm not arguing against you. I'm looking for good practices. So then this:

STORE 1 TO ;
m.lnVar1, ;
m.lnVar2, ;
m.lnVar3

is bad, but this is good?

STORE 1 to m.lnVar1
STORE 1 TO m.lnVar2
STORE 1 TO m.lnVar3

Do you then also do single replace commands instead of one big one?

How about update and insert. Do you do one field per?

Is there some harm in putting them all together in one line?


>
>
>>I see your point. But as you wrote in the first place:
>>
>>Use white space liberally. It will improve readability :-))
>>
>>STORE 0 TO lnMyVar1,;
>>           lnMyVar2,;
>>           etc.
>>
>>I dodn't find this harder to read than:
>>
>>lnMyVar1 = 0
>>lnMyVar2 = 0
>>etc.
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform