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 > %endif keyword (SDL script)
  
%endif keyword (SDL script)
The %endif keyword specifies the end of an if...then...else statement.
For more information about if...then...else statements, see if...then...else statement (SDL script).
Syntax
%if <condition> %then
<set of statements for when condition is satisfied>
[%else
<set of statements for when condition is not satisfied>]
%endif
In this example the value of the Return Type property is evaluated. If the value of the Return Type property is void, 'return;' is generated, if the value is not void, 'return ReturnValue;' is generated.
%if %custom "Return Type" == "void" %then
"return;"
%else
"return ReturnValue;"
%endif