From GridLAB-D Wiki
Macros are used by the GridLAB-D GLM loader to control how the GLM is interpreted. All macros are introduced by a hash mark, e.g.,
#if test // conditional #endif
- #binpath path
- Define the path to search for executables. DEPRECATED
- #debug string
- Prints string when debugging is enabled. New in 4.0!
- #error message
- Force the GLM loader to print an error message and stop.
- #include [using(name=value[,...])] file
- Include another GLM file.
- #incpath path
- Define the path to search for include files. DEPRECATED
- #libpath path
- Define the path to search for library files. DEPRECATED
- #option command-option
- Runs a command option Template:NEW30
- #print message
- Print a message.
- #setenv variable=value
- Set environment variables.
- #start file-name
- Start a program asynchronously.
- #system command
- Execute a command in an operating system shell.
- #warning message
- Display a warning message and continue loading the GLM file.
- #wget url
- Download a web resource from the specified URL. New in 4.0!
Variables
Macro variables are expanded in-line while the GLM file is being loaded, so expansion is immediate. The normal syntax for defining and including a macro variables is
#define my_class=test class ${my_class} { // declarations }
Macro expansions will expand macro variables, global variables, and environment variables.