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 > While loop (SDL script)
  
While loop (SDL script)
A While loop processes a set of statements until a specified condition is no longer true.
While loops can be nested.
The While loop uses the following keywords:
%while - starts the While loop and specifies the condition to be evaluated. While the condition is true, the set of statements specified by the While loop are processed. For information about working with variables, item properties, item lists and operators, see the following topics:
Keywords for working with item lists (SDL script)
Keywords for working with item properties (SDL script)
Keywords for working with variables (SDL script)
Overview of operators (SDL script)
%exit - optional keyword for exiting the While loop without processing any remaining statements. %exit keyword is typically used with the evaluation of a condition.
%endwhile - ends the While loop
Syntax
%while <condition>
<set of statements for when condition is satisfied>
[%exit]
%endwhile