## Macro

Macros are some predefined strings that can be embedded in any string based properties such as "PV Name", "Text", "Tooltip", "Scripts" and so on. Macro will be replaced with its string value at Runtime.

### Format

The macro format can be either $(macro_name) or ${macro_name}

There are two types of macros:

### Predefined Symbol Macro

It could be defined in the preference page of BOY (open it from menu: CSS->Preferences...->CSS Applications->Display->BOY) or the Macros property of container widgets: Display, Grouping Container and Linking Container.
For example: If there is a macro "1=one", the text "$(1)_two_three" will be replaced to "one_two_three" in run mode.

Attention: Macro name only allows letters and numbers (should not start with number).

### Widget Property Value Macro

This allows you access the value of a property of the widget in run mode. In this case, the macro_name is the property id of the widget property. For example, $(pv_name), $(pv_value), $(forground_color)...
A good example of Widget Property Value Macro is the tooltip: A tooltip of "$(pv_name)$(pv_value)" will display the PV Name and its value in run mode.

### System Macro

These macros are predefined in code. Here are two macros available:

- `$(DID)`: The unique ID for each display. Even if there are multiple displays refering tho the same OPI file, each display still has an unique ID. This macro is useful for avoiding name conflict. For example, if we add a prefix of `$(DID)_` to a local PV name, we can easily guarantee the PV name is unique to this display.

- `$(DNAME)`: The name of the display.