|
Navigation: Commands and Procedures > Predefined Macros > Global Macros |
![]() ![]()
|
Visual Build Pro creates the following global macros when first installed. By default, they are loaded/saved from/to the VisBuildPro.macros file in the configuration files path. Modifications to global macros are saved to disk whenever a project is saved, the GUI application is closed, and before each step is built.
The values of these global macros will be initialized when Visual Build Pro is installed, but their values can be modified if necessary. Also, by clicking the 'Reload' button on the File Locations options page, these values will be reinitialized to their default values.
Some general purpose macros:
| • | ATTRIB(filename, flags): Changes file attributes (make read-only, hidden, etc.). The Set File Attributes action can be used instead. |
| • | REGEDIT: Import or export a registry file (.reg) into/from the registry (see the RegEdit.bld sample). The Write Registry action and REG_READ macro can be used for this as well. |
Global macros are also defined for several Microsoft development tools. Visual Build Pro will attempt to locate the actual location of the tools and set the macros accordingly, but the value of these macros can be modified if necessary. Also, by clicking the 'Reload' button on the File Locations property page, these values will be reinitialized to their default values. Note that these macros are not used by the built-in Microsoft actions.
Microsoft Visual Studio (6.0 and .NET): View the Visual Studio Integration help topics for details.
Borland Tools (also see the Make Delphi action, Make JBuilder action, and Borland.bld sample):
| • | BCBDIR: The base directory for Borland C++Builder. |
| • | BCB: Invoke the C++Builder command-line executable to build a project. |
| • | BJBDIR: The base directory for Borland JBuilder. |
| • | BJB: Invoke the JBuilder command-line executable to build a project. |
| • | DELPHIDIR: The base directory for Borland Delphi. |
| • | DELPHI: Invoke the Delphi command-line executable to build a project. |
Notes: Global macros can be used for two-way communication between steps and projects. When a global macro is modified, in the GUI via the Macros pane, within a Set Macro or Run Script action, or from an external step (for instance, a child project via VisBuildPro Project action or an external script that instantiates and modifies a macro via the object model), only the in-memory macro collection is modified. However, when the objects holding that collection are disposed of (when the console or GUI app exits or references to the object model are released), if any global macro changes have been made, they will be saved to disk. Also, within a project, before each step is built, any in-memory modifications to global macros will be saved, and if the global macros file gets modified by a step, the changes will be reloaded from disk when the step completes.