Substitution Macros

Previous pageReturn to chapter overviewNext page


Some GExperts tools such as the Macro Templates editor expert and the Backup Project expert can use substitution macros in their configuration.  These macros allow various %-delimited phrases to be dynamically replaced with a context-sensitive string. The supported macros are:




The project name


The project directory


The project group name


The project group directory


The current unit name


The unit directory




The system format date


The system format date/time


The year, in four digits


The month in two digits


The short month name


The long month name


The day in two digit format


The short day name


The long day name


Hour in two-digit format


Minute in two-digit format


Second in two-digit format




The currently logged in username


The text contents of the clipboard


Selected text in the current IDE editor.  For the macro templates, the selection text will be deleted from the editor and moved to the position specified by this macro.


Selected text in the current IDE editor. For the macro templates, the selection is not deleted from the editor but instead is copied into the macro.


Queries the user for a string when executed.  The format of this macro is: "%INPUTVAR,VarName,<caption>%", where the dialog caption is optional.  For example: "%INPUTVAR,VarName,Enter a value%".  After the user has input the desired value, the value may be used as a macro later as %VarName%.


Version Information (requires version information in the IDE project options):


The project product version


The project file version


The project major version


The project minor version


The project release version


The project build version


The project product name


The project internal name


The project file description


Source Code Parsing (Delphi source only):


The identifier under the editor cursor (works for C++)


The name of the procedure after/before the cursor


The result of the procedure after/before the cursor


The arguments of the procedure after/before the cursor (all on one line)


The class and method name in the format "Class.Method" for the procedure after/before the cursor


The class name after/before the cursor (searches declarations and method definitions)


The interface name after/before the cursor


Toggles the state of looking after/before the cursor position for macro substitutions like PROCNAME, RESULT, etc.  The default is to look after the cursor.



Starts and ends a section of the substitution where the appearance of any of the three below macros reports on only a single argument of the method before/after the cursor.  This allows creating macros with an argument per line.


The name of a single argument (use after %BEGINPARAMLIST%)


The type of a single argument (use after %BEGINPARAMLIST%)


The default value of a single argument (use after %BEGINPARAMLIST%)


For Macro Templates Only (configured inside Macro Templates):


Full name of the user


Initials of the user


An auto-incremented integer sequence number


Note: To produce a literal percent (%) character in the output, type it as two consecutive percent characters (%%) to prevent an attempt to parse the percent as the start of a macro.



Examples of many of these macros can be seen by looking at the default macro templates accessed via GExperts, Configuration, Editor Experts, Expand Macro Template, Configuration.