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 > %getvar keyword (SDL script)
  
%getvar keyword (SDL script)
This keyword gets the value of a global variable.
* 
Before using a global variable, you must declare it using the %string or %numeric keyword in a Generate.sdl template. You can set the value of a global variable through the %setvar keyword.
You can use the %getvar keyword to output the value of a global variable.
Syntax
%getvar "<name of variable>"
In this example, the value of the sysWorkingDir global variable is returned.
%getvar "sysWorkingDir"
In this example, the values of strFullPath and sysSpecExtension variables is output as part of a comment.
%comment_text ("File : .\\") & (%getvar "strFullPath") & (%getvar
"sysSpecExtension")