Expansion variables

Expansion variables are used in GLM code to embed context-dependent values into property values and code. Expansion variables are always enclosed in single curly braces, e.g., {variable}.

To enable expansion variable syntax, property values must be embedded in back-quotes as shown in this example from the Getting Started Using GridLAB-D page:

The recognized expansion variables are


 * {file} embeds the full GLM file name
 * {filename} embeds the base file name (no path and no extension)
 * {filepath} embeds the path to the file (no file name or extension)
 * {fileext} embeds the file extension (no path or name)
 * {namespace} embeds the namespace
 * {class} embeds the class name
 * {gridlabd} embeds the path to the gridlabd installation
 * {hostname} embeds the host name of the machine running the code
 * {hostaddr} embeds the host IP address of the machine running the code
 * {port} embeds the port number of the server (if any)
 * {cpu} embeds the CPU id (see pstatus) that is running the code
 * {pid} embds the process id (see pstatus that is running the code
 * {mastername} embeds the master server simulation host name
 * {masteraddr} embeds the master server simulation host IP address
 * {masterport} embeds the master server port number
 * {id} embeds the object id number
 * {property} embeds the property from the current object
 * {global} embeds the value from a global variable

= See also =


 * parameter expansion
 * pstatus