BinaryFile.ReadHex
------------------

Read data and returns as hex text.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [BinaryFile](component_BinaryFile.md) | [7.3](newinversion73.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "BinaryFile.ReadHex"; BinaryFileRef; ByteCount ) 

**MBS**( **"BinaryFile.ReadHex";** /\* Read data and returns as hex text. \*/  
**$BinaryFileRef**; /\* The reference number for the open file.e.g. $FH \*/   
**$ByteCount**) /\* The number of Bytes to read.e.g. 1000 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BinaryFileRef | The reference number for the open file. | $FH |
| ByteCount | The number of Bytes to read. | 1000 |

### Result

Returns hex text or error.

### Description

Read data and returns as hex text.  
The read text may be shorter.  
### Examples

Read hex encoded data:

 Set Variable \[ $fh ; Value: MBS ( "[BinaryFile.Open](BinaryFileOpen.md)"; "/Users/cs/Desktop/test.txt" ) \]   
Set Variable \[ $data ; Value: MBS ( "BinaryFile.ReadHex"; $fh ; 1000) \]   
Set Variable \[ $r ; Value: MBS ( "[BinaryFile.Close](BinaryFileClose.md)"; $fh ) \]  
### See also

- [BinaryFile.Close](BinaryFileClose.md)
- [BinaryFile.Create](BinaryFileCreate.md)
- [BinaryFile.Open](BinaryFileOpen.md)
- [BinaryFile.ReadByte](BinaryFileReadByte.md)
- [BinaryFile.ReadFloat](BinaryFileReadFloat.md)
- [BinaryFile.ReadInt](BinaryFileReadInt.md)
- [BinaryFile.ReadPDF](BinaryFileReadPDF.md)
- [BinaryFile.ReadText](BinaryFileReadText.md)
- [BinaryFile.WriteHex](BinaryFileWriteHex.md)

### Blog Entries

- [MBS Plugin Advent calendar: 3 - BinaryFile](https://www.mbsplugins.de/archive/2023-12-03/MBS_Plugin_Advent_calendar_3_-/monkeybreadsoftware_blog_filemaker)
- [FileMaker 18 File Script Steps vs. BinaryFile functions](https://www.mbsplugins.de/archive/2019-06-03/FileMaker_18_File_Script_Steps/monkeybreadsoftware_blog_filemaker)
- [Tip of the day: Split large files into smaller chunks](https://www.mbsplugins.de/archive/2018-08-19/Tip_of_the_day_Split_large_fil/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 12nd June 2017 , last changed 12nd June 2017

  
[BinaryFile.ReadFloat](BinaryFileReadFloat.md) - [BinaryFile.ReadInt](BinaryFileReadInt.md)

[HTML Version](BinaryFileReadHex.shtml)