# GetMem1
{: .no_toc }

Reads one byte from a memory address into a **Byte** variable.

Syntax: **GetMem1** *Address* **,** *retVal*

*Address*
: *required* **LongPtr**. The address to read from.

*retVal*
: *required* **Byte**. The variable to receive the byte read from *Address*.

The address is read directly with no bounds or alignment check. Reading from an address that does not belong to the process, or from one that has been freed, will crash the host.

### Common Errors

| Error | When |
|---|---|
| [94 (`&H5E`)](/Reference/Run-time-Errors.md#94), *Invalid use of Null* | *Address* is **Null** |

### Example

```tb check_build check_run
Dim s As String = "ABC"
Dim b As Byte
GetMem1 StrPtr(s), b
Debug.Print b              ' 65 -- the low byte of the UTF-16 code unit for "A".
```

### See Also

- [GetMem2](/tB/Modules/HiddenModule/GetMem2.md), [GetMem4](/tB/Modules/HiddenModule/GetMem4.md), [GetMem8](/tB/Modules/HiddenModule/GetMem8.md), [GetMemPtr](/tB/Modules/HiddenModule/GetMemPtr.md) procedures
- [PutMem1](/tB/Modules/HiddenModule/PutMem1.md) procedure
