[FLASH-USERS] Config file IF/ENDIF

Klaus Weide klaus at flash.uchicago.edu
Wed Apr 17 10:07:10 EDT 2013


On Wed, 17 Apr 2013, Seyit Hocuk wrote:

> Dear all,
> 
> I have a rather simple question.
> Is it possible to have a "#ifdef" like condition in the Config file? I would
> like to include additional variables in certain setups, like if I have
> "PPDEFINE whatever" somewhere in some Config file. I know you can do
> "USESETUPVARS something" and with that "IF something == True".

Seyit,

1) No, you cannot use preprocessor variables defined with PPDEFINE in 
conditional expressions in Config files. This is a limitiation that is 
sometimes annoying, but makes the setup process conceptually simpler: 
first all the statements from all the included Config files (including 
PPDEFINEs) are collected, then they are applied in a final phase of 
processing (in the case of PPDEFINEs, by generating lines in Flash.h),
and the results do not depend on the order in which the various Config 
files were processed.

2) When we want something like what you seem to want, we often use setup 
with setup variables, define by shortcuts in bin/setup_shortcuts.txt,
and test them with USESETUPVARS / IF in Config files (as you know how to 
do). The setup variables can duplicate the preprocessor symbols, they 
could even have the same name. The PPDEFINE can be within an IF ... / 
ENDIF section to automate the coupling of a setup variable to a specific
preprocessor symbol.

HTH,
Klaus



More information about the flash-users mailing list