Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constant
Message
De
02/09/2006 07:41:44
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Constant
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01150492
Message ID:
01150492
Vues:
73
Hi,
Is constant evaluated only during compile time?

At first, I hardcoded my application folder as constant.
#DEFINE   APPFOLDER      "C:\myproject\"
#DEFINE   MYPRGFOLDER    APPFOLDER + "PRGS"

?MYPRGFOLDER     && Show C:\myproject\PRGS
Then, I changed my code to allow user to specify app folder during runtime. So I changed code as below.
**#DEFINE   APPFOLDER      "C:\myproject\"
#DEFINE   MYPRGFOLDER    APPFOLDER + "PRGS"

LOCAL APPFOLDER

APPFOLDER = ADDBS(GETDIR())    && User select "C:\MYPROJECT2\"
?MYPRGFOLDER     && It shows C:\myproject2\PRGS too!!!!
I was thinking constant only been evaluated during compile time.

Please advice.
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform