Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE question
Message
De
01/05/2001 14:05:54
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00502085
Message ID:
00502128
Vues:
18
Doh!

I see. I was focusing on the whole DTOC() thing and not what Rip was trying to do. Hey, btw, what is wrong with the Stars???


>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,
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform