---
title: DlgMsg
slug: dlgmsg
docTags: 
createdAt: 2023-04-19T13:20:52.000Z
---

:::hint{type="warning"}
Please note that mentioned commands may fail during loading and/or simulation.

To make your macro code avoid these errors please take a look at the manual section [Run behavior during loading of job file and simulation](docId\:p2Jh9fFRvp0WCb5jCD9px)
:::

Opens a dialog window that the operator can interact with.

The dialog can be used to input up to 12 [variable](docId\:oqHjs3LLCfQkSac_cemc2) values.&#x20;
The dialog will show the current values of the specified variables.
The specified variable values are changed according to the users' input once the dialog is submitted.

:::BlockQuote
DlgMsg \<dialog name> \<variable1 text> \<variable1 number> ... \<variable12 text> \<variable12 number>
:::

The dialog has an OK and a Cancel button.
When the user selects OK, variable `#5398`  is set to 1.
When the user selects CANCEL, variable `#5398` is set to -1.
During the job loading process, the dialog display is skipped and `#5398` is automatically set to the value of 1. The macro can give the queried variables a value before the `DlgMsg` command takes place which will serve as a default value.

The macro file can then query check these variables and proceed accordingly.



If \<dialog name>.png file exists in the *dialogPictures* directory located inside the installation directory then it will be displayed in the dialog.

### Example

`DlgMsg "Please input job parameters" width 100 height 101`

:::BlockQuote
Sub user\_3 ;Example of dlgmsg
&#x20;   \#1 = 0
&#x20;   \#2 = 0
&#x20;   \#3 = 0
&#x20;   \#4 = 0
&#x20;   \#5 = 0
&#x20;   \#6 = 0
&#x20;   \#7 = 0
&#x20;   \#8 = 0
&#x20;   \#9 = 0
&#x20;   \#10 = 0
&#x20;   \#11 = 0
&#x20;   \#12 = 0

&#x20;   ;dlgmsg will show a dialog with picture edingcnc.png from the installation directory\dialogPictures
&#x20;   dlgmsg "edingcnc" "A" 1 "B" 2 "C" 3 "D" 4 "E" 5 "F" 6 "G" 7 "H" 8 "I" 9 "J" 10 "K" 11 "L" 12

&#x20;   if \[#5398 == 1]
&#x20;       msg "OK #1="#1 "#2="#2 "#3="#3 "#4="#4 "#5="#5 "#6="#6 "#7="#7 "#8="#8 "#9="#9 "#10="#10 "#11="#11 "#12="#12
&#x20;   else
&#x20;       msg "CANCEL #1="#1 "#2="#2 "#3="#3 "#4="#4 "#5="#5 "#6="#6 "#7="#7 "#8="#8 "#9="#9 "#10="#10 "#11="#11 "#12="#12
&#x20;   endif

Endsub
:::

![](https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/Mnsi8OwGFvy9ptgjyLBTB_image.png)

