Constant Value Editor
The Constant Value Editor defines the global constants used in scripts. Give frequently used fixed values a name and use the name instead of the number in scripts. The tab title shows Constant Editor.
Ways to open it:
- Solution Explorer → Data Editor Pages → Constant Value Editor
- Project → Global Constant Editor menu, or the Constant Value Editor button on the toolbar
- In the script editor, place the caret on a constant name and press
F12(go to definition)
The path of the edited file (RunScript\ConstantValue.XDF) is shown at the top.

Table and buttons
| Item | Description |
|---|---|
| Define | Constant name. Case is ignored, and duplicates are not saved. |
| Value | Constant value |
| Description | Description |
| Zoom in · Zoom out · 1:1 | Table text size |
| SAVE | Saves to the file and reloads the constants. |
| RESTORE | Returns to the file contents after confirmation. |
- Click or drag the row numbers to select whole rows.
- While editing,
*is added to the tab title.
Caution Changes made with the
Deletekey,Ctrl+Xor Increment Number do not add the*to the tab title, and closing the tab with only such changes discards them without asking. Press SAVE right after such edits.
Context menu
| Menu | Action |
|---|---|
| Add Row | Inserts an empty row below the selected row. |
| Insert Copied Cells | Shown only when the clipboard has several lines and the first column (Define) is selected. Inserts the copied lines as new rows below the selected row. |
| Duplicate Row | Copies the selected row right below it. |
| Move Up · Move Down | Moves the selected row by one. |
| Delete Row | Deletes the selected rows (several rows allowed). |
| Increment Number | With several cells selected in one column, fills the cells below with the top cell's number increased by 1 each. Enabled when the top cell is an integer; disabled when the selection starts at the first row. |
Shortcuts
| Shortcut | Function |
|---|---|
Delete | Clear the selected cells |
Ctrl+Delete | Delete row |
Ctrl+C / Ctrl+V / Ctrl+X | Copy / paste / cut cells |
Ctrl+D | Duplicate row |
Ctrl+Z / Ctrl+Shift+Z | Undo / redo |
Ctrl+0 / wheel | Table text 100% / zoom in and out |
Ctrl+S | Save all and build (also saves this screen) |
Using constants in scripts
Constants registered here are used by name in scripts. They are replaced by their values at build time, so they cost nothing at run time.
// If DEFAULT_SLEEP = 100 is registered in the Constant Value Editor
Sleep(DEFAULT_SLEEP);- If a variable has the same name as a constant, the variable is read in that scope and the build shows a warning. Rename the variable to use the constant.
- If a name matches a built-in constant (
EB_Ok,ER_Yes, etc.), the value registered here takes precedence.
Constants pay off for values used in several places or likely to change all at once later (wait times, repeat counts, vision tool numbers, etc.). See XScript — Language Basics for the detailed rules.