| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
Matrix.SwapRows
Swaps two rows in the matrix.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| Matrix | 16.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Matrix.SwapRows"; MatrixRef; Row1; Row2 ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| MatrixRef | The matrix reference number. | $matrix |
| Row1 | The zero based row number. | 2 |
| Row2 | The zero based row number. | 4 |
Result
Returns OK or error.
Description
Swaps two rows in the matrix.Examples
Swap two rows:
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.SwapRows"; 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.SwapRows"; 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