%inlist keyword (SDL script)
This keyword is used with the %if keyword to evaluate whether the current item is in a specified global list. If the current item is in the specified list, True is returned.
The current item is derived as follows:
ACS calls the top-level Generate.sdl generation template for each item (Model, Package or Class) that is selected either directly or indirectly for generation. On entering the Generate.sdl generation template, the selected Model, Package or Class is the current item.
The current item remains as the selected Model, Package or Class until a For loop iterates a collection of linked items or items in a list. During a For loop, the current item is the item that is currently being iterated.
After leaving a For loop, the current item reverts to the item that was the current item before entering the For loop.
Syntax
%if %inlist "<list name>" %then
In this example the %inlist keyword evaluates whether the current Data Type is in the ForwardDeclaredObjects global list. If the current Data Type is in the ForwardDeclaredObjects global list, the IncludeThisObject.sdl generation template is loaded.
%for "Data type"
%if %inlist "ForwardDeclaredObjects" %then
%load "IncludeThisObject.sdl"
%endif
%endfor