# Set
> [HTML Version](set_mx138.htm)
**xcall MIAMEX, MX\_REGISTRY, REGOP\_SET, hkey, name, type, value, status**
This is used to write a new or updated value to the Registry.
**Parameters**
_hkey _(B,4) \[in\]
must be set to the _hkeynew _value returned from a previous call to Create or Open a key.
_name _([String](string.htm.md)) \[in\]
is the name of the value to write. (These are the items that appear in the left side of the right hand pane of regedit.exe.)
_type _([Num](num.htm.md)) \[in\]
specifies the type of value you want to write:
| **Symbol** | **Value** | **Description** |
|------|------|------|
| REG\_NONE | 0 | No type |
| REG\_SZ | 1 | Null terminated string |
| REG\_EXPAND\_SZ | 2 | Same as (1) but signals that string may contain embedded environment variables (e.g. %temp%\\xyx.log) |
| REG\_BINARY | 3 | Raw binary data (use X format) |
| REG\_DWORD | 4 | 4 byte integer (use B,4 format) |
| REG\_MULTI'SZ | 7 | List of null terminated strings, with a double null terminating the list. See [Replace Null Delimiters](replacenulldelimiters.htm.md) for an alternative to using null delimiters (with are hard to work with in BASIC). |
| **Definition file: [ashell.def](ashell_def.htm.md)** | |
_value_ ([String](string.htm.md) or B,4 depending on _type_) \[in\]
The data to write to the named item.
_status_ (F6) \[out\]
0 for success, else error code.