| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
Matrix.SwapColumns
Swaps two columns in the matrix.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| Matrix | 16.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Matrix.SwapColumns"; MatrixRef; Column1; Column2 ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| MatrixRef | The matrix reference number. | $matrix |
| Column1 | The zero based column number. | 2 |
| Column2 | The zero based column number. | 4 |
Result
Returns OK or error.
Description
Swaps two columns in the matrix.Examples
Swap columns:
Let ([
// split a CSV
matrix = MBS( "Matrix.CSVSplit"; "FirstName;LastName;City¶Joe;Miller;Las Vegas¶Bob;\"Johnson-Meyer\";\"Köln\"");
// swap first and second row
r = MBS("Matrix.SwapColumns"; matrix; 1; 2);
// and ask for text back with column names in first row
text = MBS("Matrix.CSV"; matrix);
r = MBS("Matrix.Release"; matrix)
]; text )
// split a CSV
matrix = MBS( "Matrix.CSVSplit"; "FirstName;LastName;City¶Joe;Miller;Las Vegas¶Bob;\"Johnson-Meyer\";\"Köln\"");
// swap first and second row
r = MBS("Matrix.SwapColumns"; matrix; 1; 2);
// and ask for text back with column names in first row
text = MBS("Matrix.CSV"; matrix);
r = MBS("Matrix.Release"; matrix)
]; text )
See also
Release notes
- Version 16.2
- Added Matrix.SearchAndReplace, Matrix.SwapColumns and Matrix.SwapRows functions.
Blog Entries
This function checks for a license.
Created 22nd March 2026, last changed 22nd March 2026