Navigation: Using Visual Build > Dialogs > Macro Properties Dialog |
|
The Macro Properties dialog can be 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 (if the related option to edit properties via the properties pane when inserting is unchecked). To edit an existing macro, click the properties icon on the toolbar, select View | Properties Dialog on the menu, or press Enter.
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. 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 |
Dialog Fields
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, comma, 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: Determines whether the macro value is encrypted when displayed and when stored in the project file. Unchecking this option for an existing encrypted macro is disabled.
Buttons on the Dialog
Insert Macro: Displays the Insert Macro dialog to add other macros to the current macro's value. A list of all defined macros is displayed, and double-clicking the macro inserts it into the field at the current cursor position. Macro names can also be entered manually. A macro is indicated by placing a percent sign (%) on each side of the macro name (i.e., %DOSCMD%).
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).