# Function Reference

# BinaryMid

Extracts a number of bytes from a binary variant.

BinaryMid ( binary, start [, count] )

## Parameters

binary | The binary data to evaluate.
start | The byte position to start. (1 = first byte)
count | [optional] The number of bytes to extract. By default the entire remainder of the binary data.

## Return Value

Returns the extracted binary data.

## Remarks

If start is out-of-bounds, an empty binary variant is returned. If start is valid but count is out-of-bounds, the entire remainder of the binary data is returned.

## Related

Binary, BinaryLen

## Example

    #include <MsgBoxConstants.au3>

    Local $dBinary = Binary("0x10203040") ; Create binary data from a string.
    Local $dExtract = BinaryMid($dBinary, 2, 2)
    MsgBox($MB_SYSTEMMODAL, "", "The 2nd and 3rd bytes are: " & $dExtract)