SyntaxColoring.Format
---------------------

Applies formatting rules to the formula text and returns styled text.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SyntaxColoring](component_SyntaxColoring.md) | [3.0](newinversion30.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "SyntaxColoring.Format"; Text; Copy ) 

**MBS**( **"SyntaxColoring.Format";** /\* Applies formatting rules to the formula text and returns styled text. \*/  
**$Text**; /\* The formula text to format.e.g. "5+6+cos($test)" \*/   
**$Copy**) /\* Pass 1 to copy result to clipboard.  
This preserves links and all formatting. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The formula text to format. | "5+6+cos($test)" |
| Copy | Pass 1 to copy result to clipboard.   This preserves links and all formatting. |  |

### Result

Returns formatted text.

### Description

Applies formatting rules to the formula text and returns styled text.  
### Examples

Format a line:

 $r = MBS ( "SyntaxColoring.Format"; "5+6+cos($test )" )  
### See also

- [SyntaxColoring.AddTag](SyntaxColoringAddTag.md)
- [SyntaxColoring.Clear](SyntaxColoringClear.md)
- [SyntaxColoring.Enable](SyntaxColoringEnable.md)
- [SyntaxColoring.FormatCalculation](SyntaxColoringFormatCalculation.md)
- [SyntaxColoring.GetTag](SyntaxColoringGetTag.md)
- [SyntaxColoring.GetTags](SyntaxColoringGetTags.md)

### Release notes

- **Version 14.1**
    - Added [SyntaxColoring.FormatCalculation](https://www.mbsplugins.eu/SyntaxColoringFormatCalculation.shtml) function.
- **Version 12.5**
    - Fixed a problem in [SyntaxColoring.Format](https://www.mbsplugins.eu/SyntaxColoringFormat.shtml) function.
- **Version 12.4**
    - Fixed a bug in [SyntaxColoring.Format](https://www.mbsplugins.eu/SyntaxColoringFormat.shtml) raising exception if a color is not defined.
- **Version 11.3**
    - Removed text size limit for [SyntaxColoring.Format](https://www.mbsplugins.eu/SyntaxColoringFormat.shtml) function.
- **Version 10.0**
    - Fixed problem with [SyntaxColoring.Format](https://www.mbsplugins.eu/SyntaxColoringFormat.shtml) function.

### Example Databases

- [JSON/JSON Tests](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/JSON/JSON%20Tests.shtml#1298FieldAnchor_)
- [Utility functions/Evaluate](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/Evaluate.shtml#1ScriptAnchor_)
- [Utility functions/FileMaker Custom Functions via Dictionary](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/FileMaker%20Custom%20Functions%20via%20Dictionary.shtml#8ScriptAnchor_)
- [Utility functions/FileMaker Custom Functions](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/FileMaker%20Custom%20Functions.shtml#8ScriptAnchor_)
- [Utility functions/Formula Formatting](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Utility%20functions/Formula%20Formatting.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 12.5pr1](https://www.mbsplugins.de/archive/2022-09-29/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.4pr4](https://www.mbsplugins.de/archive/2022-08-30/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.3pr7](https://www.mbsplugins.de/archive/2021-07-09/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Formatting and error checking expressions in FileMaker](https://www.mbsplugins.de/archive/2019-12-06/Formatting_and_error_checking_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.6pr1](https://www.mbsplugins.de/archive/2019-12-02/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [Define hot keys for functions in the FileMaker development](https://www.mbsplugins.de/archive/2019-11-15/Define_hot_keys_for_functions_/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.0pr10](https://www.mbsplugins.de/archive/2012-12-01/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 12nd December 2016

  
[SyntaxColoring.FactoryDefaults](SyntaxColoringFactoryDefaults.md) - [SyntaxColoring.FormatCalculation](SyntaxColoringFormatCalculation.md)

[HTML Version](SyntaxColoringFormat.shtml)