Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Finds index of first value matching value.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Matrix | 14.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
MatrixRef | The matrix reference number. | $matrix | |
Column | Which column to search. | 0 | |
Operator | The compare operator. Can be =, !=, <, >, <=, >=, ≤, ≥, ≠, Prefix or Postfix. |
"≥" | |
Value | The value to compare. | "Test" | |
StartRow | The row to start at. Default is 0. |
0 | Optional |
Returns OK or error.
Try it:
Let([
matrix = MBS("Matrix.New"; 5; 5);
r = MBS( "Matrix.SetRow"; matrix; 0; "1¶3" );
r = MBS( "Matrix.SetRow"; matrix; 2; "123¶5" );
r = MBS( "Matrix.SetRow"; matrix; 3; "3¶4" );
index = MBS( "Matrix.IndexOfFirstValueMatching"; matrix; 0; "="; 123 )
]; index)
Example result: 2
Try prefix and postfix:
Let([
matrix = MBS("Matrix.New"; 5; 5);
r = MBS( "Matrix.SetRow"; matrix; 0; "1¶3" );
r = MBS( "Matrix.SetRow"; matrix; 2; "123¶5" );
r = MBS( "Matrix.SetRow"; matrix; 3; "Hello¶4" );
index1 = MBS( "Matrix.IndexOfFirstValueMatching"; matrix; 0; "prefix"; "He" );
index2 = MBS( "Matrix.IndexOfFirstValueMatching"; matrix; 0; "postfix"; "23" );
index3 = MBS( "Matrix.IndexOfFirstValueMatching"; matrix; 1; "="; "4" )
]; index1 & ¶ & index2 & ¶ & index3)
Example result:
3
2
3
This function checks for a license.
Created 21st November 2023, last changed 22nd November 2023