Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE question
Message
 
 
À
01/05/2001 13:37:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00502085
Message ID:
00502124
Vues:
23
The problem is that when you go to retrieve that value, it will always return the current date. What #DEFINE does is a global LITERAL replace of COMPILE_DATE with DTOC(DATE() or DATETIME(). The constant does not get replaced with the evaluation of the function when compiled.

Something like the following does work for me:

#DEFINE CURRENT_FOLDER SYS(5) + SYS(2003)

because it will always return the currently selected folder at runtime instead of the folder the app was in when I compiled it. This is because SYS(5) + SYS(2003) is a literal replacement of every occurrence of CURRENT_FOLDER instead of what SYS(5) + SYS(2003) evaluated to at compile time.

>Just tested it: It worked for me in an EXE made up of a PRG with that as the first line. Hmmmm......
>
>>I would like to create a constant that represents the date a program was compiled on.
>>
>>The following does NOT work:
>>
>>#DEFINE COMPILE_DATE DTOC(DATE())
>>
>>
>>Can it be done?
>>
>>TIA,
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform