# MX\_CMD\_STATUS
> [HTML Version](mx_cmd_status.htm)
_Reviewed and revised April 2024_
**xcall MIAMEX, MX\_CMD\_STATUS, cmdcode**
MX\_CMD\_STATUS (MIAMEX 1) sets the command file status, returning the previous status.
**Parameters**
_cmdcode_ ([Unsigned Int](integer-unsigned.htm.md)) \[in/out\]
Sets the new command file status and retrieves the prior status, based on the following table.
| **Value** | **Meaning** |
|------|------|
| 0 | No command file currently running |
| 1 | Command file is in silent (:S) mode |
| _2_ | Command file is in response (:R) mode |
| 3 | Command file is in trace (:T) mode |
| 4 | Command file is executing last line while in silent mode |
**Comments**
To retrieve the current status without changing it, make a copy of the returned status and call it a second time. For example:
map1 cmdcode,b,1
map1 cmdcode2,b,1
xcall MIAMEX, MX\_CMD\_STATUS, cmdcode \! retrieve current status, set new status to 0
cmdcode2 = cmdcode \! copy of original status
xcall MIAMEX, MX\_CMD\_STATUS, cmdcode2 \! reset the original status
? "Current status is "; cmdcode