Yes, that is the idea of #DEFINE constants - that they are evaluated at compile time. They are replaced in the program before the main phase of the compilation. For instance, if you use:
#DEFINE MAX_USERS 100
Then the compiled file will not have any variable MAX_USERS; instead, it will have the value 100 everywhere you had used MAX_USERS.
For the need you describe, you should use a variable, not a #DEFINE.
>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
>
>
>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())
>?MYPRGFOLDER
>
>
>I was thinking constant only been evaluated during compile time.
>
>Please advice.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)