Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datetime() operations
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01411971
Message ID:
01412048
Vues:
62
This message has been marked as a message which has helped to the initial question of the thread.
>What is the advantage of using constantes rather the public variables ?


Constants are BUILT-IN during the compilation time.
You CAN'T change them. You ever will get and error message if you want to :-)
(I really missed CLIPPER Case-sensitive #define compilation)

Try this:
#define TEST "MyTest"
MessageBox(TEST)
TEST = "TestMe" && BOOM even before you start the program (if you have set "Compile before saving" to true)
MessageBox(TEST)
test = 12       && BOOM even before you start the program (if you have set "Compile before saving" to true)
MessageBox(TEST)
Compilator just find ALL instances of left part of the define class in current routine and change it to the right part of it.
So in that example AFTER compilation VFP will execute this (and that is the actual code in your EXE):
MessageBox("MyTest")
"MyTest" = "TestMe"
MessageBox("MyTest")
"MyTest" = 12
MessageBox("MyTest")
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform