Container.GetHex
----------------

Returns the hex encoded value of the container.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Container](component_Container.md) | [6.5](newinversion65.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Container.GetHex"; Container { ; Name or Index } ) 

**MBS**( **"Container.GetHex";** /\* Returns the hex encoded value of the container. \*/  
**$Container**; /\* The container field or value to inspect.e.g. MyTable::MyContainerField \*/   
**$Name or Index**) /\* Optional; Either the name of the Type or it's index  
Version 12.2 returns main item if this parameter is empty.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Container | The container field or value to inspect. | MyTable::MyContainerField |  |
| Name or Index | Either the name of the Type or it's index   Version 12.2 returns main item if this parameter is empty. | 0 | Optional |

### Result

Returns data or error.

### Description

Returns the hex encoded value of the container.  
You must tell the plug-in which of the types in the container field you want to use. You can use either it's name (JPEG, TIFF, PNGf etc) or it's index. The index is from 0 to the count of types -1 You can use [Container.GetCount](ContainerGetCount.md) to return the count of types in the container.  
You can pass index zero and get data form references file in case container is a file reference.  
### Examples

Get Container as Hex:

 MBS ( "Container.GetHex"; MyTable::MyContainerField )  
### See also

- [Container.GetCount](ContainerGetCount.md)
- [Container.GetHeight](ContainerGetHeight.md)
- [Container.GetName](ContainerGetName.md)
- [Container.GetSize](ContainerGetSize.md)
- [Container.GetText](ContainerGetText.md)
- [Container.GetType](ContainerGetType.md)
- [Container.GetTypes](ContainerGetTypes.md)
- [Text.EncodeToHex](TextEncodeToHex.md)

### Release notes

- **Version 15.2**
    - Changed [Container.GetHex](https://www.mbsplugins.eu/ContainerGetHex.shtml) to have name or index parameter optional.
- **Version 12.2**
    - Changed [Container.GetBase64](https://www.mbsplugins.eu/ContainerGetBase64.shtml) and [Container.GetHex](https://www.mbsplugins.eu/ContainerGetHex.shtml) to return main container item if no index is passed.

### Blog Entries

- [MBS FileMaker Plugin, version 15.2pr4](https://www.mbsplugins.de/archive/2025-04-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.2pr3](https://www.mbsplugins.de/archive/2022-04-21/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.5pr9](https://www.mbsplugins.de/archive/2016-12-05/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 30th November 2016 , last changed 10th April 2025

  
[Container.GetHeight](ContainerGetHeight.md) - [Container.GetJPEGHeight](ContainerGetJPEGHeight.md)

[HTML Version](ContainerGetHex.shtml)