Navigation:  Using Visual Build > Panes >

Macros Pane

Previous pageReturn to chapter overviewNext page

The Macros pane is used to manage Visual Build macros.  It is accessed by clicking on the Macros pane in the Step Panes, or by choosing the Macros item on the View menu.  Macros provide a powerful capability that can be used to make projects more dynamic and generic.

 

Macros

 

There are four (4) types of macros:

 

Temporary macros are macros that exist only for the current Visual Build instance.  They are assigned by passing in a VisBuildPro Project action or on the command-line, by inserting under the Temporary node above, or by creating them during a build in Set Macro step actions.  These can be useful for temporary values that are not needed beyond the processing of a build, or to pass in dynamic values used in a build.

 

Project macros are saved with the project file.

 

Global macros are global across all projects and are stored in VisBuildPro.macros file in the configuration files path.  Visual Build predefines several global macros, and additional global macros can be created here or within a build using the Set Macro action.  Changes to global macros are saved before each step is built and reloaded (if changed externally) after a step is built and can be used to transfer values between projects.

 

System macros are the Windows environment variables plus several built-in macros and tools.  System macros cannot be changed by the user.

 

Macros are referenced within properties of steps or macros using a format of %MACRO_NAME%.  If the same macro exists for more than one type of macro, the following order of precedence (from highest to lowest) determines which macro is used:

Temporary
Project
Global
System (Environment variables take precedence over predefined Visual Build system macros)

 

Macro overrides can be very useful; for instance, a project macro could be defined as a default value, but a temporary macro passed on the command-line when building the project.  This temporary macro would override the value defined for that project macro.

 

Macros can be cut, copied and pasted from within the Macro tab and from one Visual Build instance to another.  A macro can be renamed by clicking twice on its name or pressing F2.  Macro names are not case sensitive.  When the mouse cursor is held over the Value column, its expanded value will be shown in a tool tip.

 

The Macros pane is updated when the build pauses or stops at a breakpoint and can be manually refreshed by choosing View | Refresh on the menu.