Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

Matrix.GetValue

Queries a single value.

Component Version macOS Windows Linux Server iOS SDK
Matrix 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Matrix.GetValue"; MatrixRef; Row; Column )   More

Parameters

Parameter Description Example
MatrixRef The matrix reference number. $matrix
Row The zero based row number. 2
Column The zero based column number. 2

Result

Returns value or error.

Description

Queries a single value.
Retains original data type.
See also Matrix.Lookup function.

Examples

Test setting and getting values:

Set Variable [ $matrix ; Value: MBS( "Matrix.New"; 3; 4 ) ]
Set Variable [ $r ; Value: MBS( "Matrix.SetValue"; $matrix; 0; 0; "Hello" ) ]
Set Variable [ $r ; Value: MBS( "Matrix.SetValue"; $matrix; 1; 0; 123,456 ) ]
Set Variable [ $r ; Value: MBS( "Matrix.SetValue"; $matrix; 2; 0; Get(CurrentTimestamp )) ]
Set Variable [ $t ; Value: MBS( "Matrix.GetValue"; $matrix; 0; 0) ]
Set Variable [ $v ; Value: MBS( "Matrix.GetValue"; $matrix; 1; 0) ]
Set Variable [ $z ; Value: MBS( "Matrix.GetValue"; $matrix; 2; 0) ]
Show Custom Dialog [ "Results" ; $t & ¶ & $v & ¶ & $z ]
Show Custom Dialog [ "Results" ; MBS("FM.DataType"; $t) & ¶ & MBS("FM.DataType"; $v) & ¶ & MBS("FM.DataType"; $z) ]
Set Variable [ $r ; Value: MBS( "Matrix.Release"; $matrix ) ]

Use column name to read value:

Let ([
// split a CSV
matrix = MBS( "Matrix.CSVSplit"; "FirstName;LastName;City¶Joe;Miller;Las Vegas¶Bob;\"Johnson-Meyer\";\"Köln\"");
// now move first row into column names
firstRow = MBS("Matrix.GetRow"; matrix; 0);
r = MBS("Matrix.SetColumnNames"; matrix; firstRow);
r = MBS("Matrix.RemoveRow"; matrix; 0);
// now you can use column names to find columns!
text = MBS("Matrix.GetValue"; matrix; 0; "City");
r = MBS("Matrix.Release"; matrix)

]; text )

See also

This function checks for a license.

Created 8th April 2019, last changed 24th September 2023


Matrix.GetText - Matrix.HTML

💬 Ask a question or report a problem