Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

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

Blog Entries

This function checks for a license.

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


Matrix.GetText - Matrix.HTML