%getparam keyword (SDL script)
This keyword gets the value of a parameter that has been passed by the calling generation template.
* 
When a generation template is called through the %load keyword, you can specify parameters to pass through the %param keyword. You can set the value of the passed parameter through the %setparam keyword.
Syntax
%getparam "<parameter name>"
If you want to set a variable to a passed parameter that is a string, you must use the following syntax:
%setlocalvar "<variable name>" = (%getparam "<parameter name>") & ("")
In this example, the Class.sdl generation template declares a local variable named nGeneratingCFile. The Class.sdl generation template then loads the Attribute.sdl generation template and passes the nGeneratingCFile local variable as a parameter:
%localnumeric "nGeneratingCFile"
...
%load "Attribute.sdl" %param "nGeneratingCFile"
The called Attribute.sdl generation template declares a local variable of the same name, and then sets this variable to that of the passed parameter:
%localnumeric "nGeneratingCFile"
...
%setlocalvar "nGeneratingCFile" = %getparam "nGeneratingCFile
Was this helpful?