In the API template file use a
#if(‘$<parameter>‘ == 0) for conditional compilation
if (‘$<parameter>‘) for program flow
where <parameter> is the name you have given in the symbol creation dialog.
One extra comment: default Cypress constants for use in API parameters evaluation are 'true' and 'false' (lowercase letters), not 'True' / 'False'. So use lowercase only. For example, for both parameters being true, the result of compilation will be different: #define CASE1 (($param1==true) & ($param2==true)) Compiled file: #define CASE1 true And this line will not be evaluated: #define CASE1 (($param1==1) & ($param2==1)) Compiled file: #define CASE1 (($param1==1) & ($param2==1))1 of 1 people found this helpful
I have learnt not to test booleans for true or false. In your examples we were taught to write
#define CASE1 ((`$param1`)&&(`$param2`))
C-language defined false to be zero, so true is defined as being non-zero.
Imagine what the different behaving is, when $param1 has the value of 27 (or any other).
Thanks Bob and odissey1 this was what i needed to know.
I was using the < and > characters and the ' instead of ` characters.