|
Navigation: Using Visual Build > Dialogs > Macro Properties Dialog |
![]() ![]()
|
The Macro Properties dialog is used to add new macros and modify existing macros. To add a new macro, switch to the Macros pane, and click the Insert icon on the toolbar, choose Edit | Insert on the menu bar, or press Insert. To edit an existing macro, click the properties icon on the toolbar, select View | Properties on the menu, or press Enter.

Macros replace a particular string in the project with another string. Using macros, you can:
| • | Make your project generic |
| • | Define common commands for use in projects |
| • | Use predefined commands that are available as part of Visual Build |
| • | Create a generic project that can be used with variable parameters |
| • | Specify options for commands used in multiple project steps |
Name: Required. Used to reference the macro in the project steps or other macros (i.e., %MACROX% in a step field will be expanded to the value of the macro named MACROX when the step is built). Macros can contain any characters other than the left/right parenthesis, percent sign (%), or space. Macro names are matched without case sensitivity.
Parameters: Specifies parameters that can be passed to the macro. Parameters are separated by commas (optional).
Note: This field is disabled by default, but it can be enabled by unchecking the related option.
Value: The value to replace a reference to this macro with. If the macro has parameters, each parameter must be used at least once in the macro value. Macros can reference other macros to 20 levels of nesting (although a macro cannot reference itself). To reference a macro in a macro value or step field, place a percent sign (%) sign around the macro name (i.e., %DEVSTUDIODIR%). If other macros are referenced, a tool tip shows the expanded macro value when the mouse cursor is held over the field.
Note: Bracket characters [ and ] and the percent sign character % within a macro's value have special meaning in a macro value.
Description: A comment describing the purpose of the macro (optional).
Category: A category to group the macro in when displayed in the macros pane (optional).
Add to environment variables: If this box is checked, the macro's value will be added to the environment variable for any external programs that are called in subsequent steps.
Encrypt macro value: Available only when creating macros. Determines whether the macro value will be encrypted when stored in the project file.
Macros can be used in most step fields and within other macros. You can define your own macros, use existing environment variables, or use the predefined Visual Build macros in your projects.
Browse: Displays a file selection dialog for inserting a filename into a macro value.
Shell: Displays a popup menu for performing an operation on the currently selected filename or folder. This provides a handy way to open a file in its associated application (Launch), view a file in the user-configured viewer (View), or to open a folder in Windows Explorer (Explore).