#IFDEFINED

#IFDEFINED( definition, defaultValue )

definitionThe name of an ECL definition.
defaultValueThe default value to use if the definition does not exist.

#IFDEFINED determines whether or not the definition has been defined at the point it appears in the code. If it has been defined, it generates the definition. If it has not been defined, it generates the defaultValue.

Example:

definitions := MODULE
  EXPORT val1 := 'hi';
END;
root := MODULE
  EXPORT val2 := 'defined';
END;

val1 := 'me';
#IFDEFINED(val1, 'val1 undefined');  //me
IF(#IFDEFINED(val1, 'val1 undefined') = 'me','FRED','JOEY'); //FRED
IF(#IFDEFINED(val1, 'val1 undefined') = 'me too','FRED','JOEY'); //JOEY

#IFDEFINED(val2, 'val2 undefined'); //val2 undefined

#IFDEFINED(definitions.val1, 'definitions.val1 undefined'); //hi
#IFDEFINED(root.val2, 'root.val2 undefined'); //defined

See Also: #ISDEFINED