Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Constant
Message
From
02/09/2006 07:41:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Constant
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01150492
Message ID:
01150492
Views:
72
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...
Next
Reply
Map
View

Click here to load this message in the networking platform