#DEFINE Sunday 1 >>>>#DEFINE Saturday 7 >>>>#DEFINE AWeekend INLIST( iDayOfWeek, Saturday, Sunday ) >>>> >>>>CLEAR >>>>dCurrent = DATE() >>>>iDayOfWeek = DOW( dCurrent ) >>>>IF (AWeekend) THEN >>>> ? "Yes it's a weekend." >>>>ELSE >>>> ? "Not a weekend" >>>>ENDIFIn my Edit, Preferences, I have 'Compile when saved' checked. After compiling the prg and running it for today (Monday), I get "Not a weekend", and then I changed the date to Sunday using my system clock and immediately ran the prg again (without any modifications and/or recompiling) - as expected the message changed to "Yes it's a weekend."
#DEFINE DEFAULT_DIR SYS(5) + SYS(2003)in a header file. Compile the application and drop it into a directory other than the compiled directory. It will display the current default directory, not the one that the application was compiled in.
#DEFINE DEFAULT_DIR SYS(5) + SYS(2003) CLEAR ? DEFAULT_DIR ? SYS(5) + SYS(2003)As expected, both lines return the same value - i.e. they are both evaluated at run-time not compile-time. I re-assert that the pre-processor in the VFP compiler does not evaluate anything at compile-time. All that is happening is the strings are swapped by the compiler before tokenization!