Matrix.AddColumns
-----------------

Adds columns to a matrix.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Matrix](component_Matrix.md) | [9.2](newinversion92.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Matrix.AddColumns"; MatrixRef { ; Count } ) 

**MBS**( **"Matrix.AddColumns";** /\* Adds columns to a matrix. \*/  
**$MatrixRef**; /\* The matrix reference number.e.g. $matrix \*/   
**$Count**) /\* Optional; The number of columns to add.  
Default is 1.e.g. 2 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| MatrixRef | The matrix reference number. | $matrix |  |
| Count | The number of columns to add.   Default is 1. | 2 | Optional |

### Result

Returns OK or error.

### Description

Adds columns to a matrix.  
### Examples

Add columns and set values:

 Set Variable \[ $r ; Value: MBS ( "Matrix.AddColumns"; $matrix ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetColumn](MatrixSetColumn.md)"; $matrix ; 3; "2¶4¶12" ) \]   
Set Variable \[ $r ; Value: MBS ( "[Matrix.SetColumn](MatrixSetColumn.md)"; $matrix ; 4; “6¶8¶39" ) \]  
### See also

- [Matrix.Add](MatrixAdd.md)
- [Matrix.AddColumn](MatrixAddColumn.md)
- [Matrix.CopyColumn](MatrixCopyColumn.md)
- [Matrix.GetColumn](MatrixGetColumn.md)
- [Matrix.SetColumn](MatrixSetColumn.md)
- [Matrix.SwapColumns](MatrixSwapColumns.md)

### Blog Entries

- [Matrix functions for FileMaker](https://www.mbsplugins.de/archive/2019-05-28/Matrix_functions_for_FileMaker/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 8th April 2019 , last changed 17th December 2019

  
[Matrix.AddColumn](MatrixAddColumn.md) - [Matrix.AddRow](MatrixAddRow.md)

[HTML Version](MatrixAddColumns.shtml)