Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > SDL script for generating code > Keywords > %or keyword (SDL script)
  
%or keyword (SDL script)
This keyword is used as a logical OR operator, allowing you to OR multiple conditions. When ORing conditions, True is returned if any condition is True. Each condition must be enclosed in parentheses.
If you use only the %or keyword when evaluating multiple conditions, the order of the conditions does not matter; however, if you use both %and and %or keywords to evaluate multiple conditions, the order of the conditions is important. The following example demonstrates the order in which multiple conditions are processed.
%if (<condition 1>) %and/%or (<condition 2>) %and/%or (<condition 3>) %and/%or (<condition 4>) then...
In this example the conditions are evaluated as follows:
Condition 1 is evaluated against Condition 2.
The result of the preceding evaluation is evaluated against Condition 3.
The result of the preceding evaluation is evaluated against Condition 4.
If you are using a both %and and %or keywords with multiple conditions, you must order conditions correctly to achieve the required result.
Syntax
%if (<condition 1>) %or (<condition 2>)%or (<condition n>) %then...
In this example, the strPrintParam local variable is set to '.3g' only if the strDataType local variable is equal to DOUBLE or FLOAT.
%if (%getlocalvar "strDataType" == "DOUBLE") %or
(%getlocalvar "strDataType" == "FLOAT") %then
%setlocalvar "strPrintParam" = ".3g"
%endif