Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When to use parenthases after commands?
Message
De
16/08/2006 05:04:22
 
 
À
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:
01145911
Vues:
26
>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.
>

look this.

Example,
"I want store the current datetime() into two variables":

Incorrect program:
var1= DATETIME() 
var2= m.var1
Correct program,
but
1 it is sensitive to the future changes of the code,
2 the read of the syntax is slow
3 the execution is slow
dummy=DATETIME() 
var1= m.dummy
var2= m.dummy
* don't forget this
RELEASE dummy
Correct program,
1 insensitive, you have to change the program line
2 read is fast
3 execution is fast
STORE DATETIME() TO var1, var2
unfortunately in VFP the execution of a line of code is not ACID,
but this is another issue ....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform