Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Matrix.ConvertDataType
Converts the data types.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Matrix | 12.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
MatrixRef | The matrix reference number. | $matrix | |
DataType | The new data type. Can be Number, Container, Date, Time, TimeStamp or Text. |
"Text" | |
firstRow | The index of first row. Default is 0. |
0 | Optional |
lastRow | The index of last row. Default is Matrix.Height-1. |
5 | Optional |
firstCol | The index of first column. Default is 0. |
0 | Optional |
lastCol | The index of last column. Default is Matrix.Width-1. |
6 | Optional |
Result
Returns OK or error.
Description
Converts the data types.We loop over all rows in all columns for the range and convert the value to the given type.
Examples
Try this function:
Set Variable [ $matrix ; Value: MBS( "Matrix.New"; 3; 3 ) ]
Set Variable [ $r ; Value: MBS( "Matrix.SetColumn"; $matrix; 0;"15¶07¶92" ) ]
# get value
Set Variable [ $v1 ; Value: MBS( "Matrix.GetValue"; $matrix; 0; 0 ) ]
Set Variable [ $d1 ; Value: MBS( "FM.DataType"; $v1) ]
Set Variable [ $r ; Value: MBS( "Matrix.ConvertDataType"; $matrix; "number"; 0; 2; 0; 2) ]
# get value
Set Variable [ $v2 ; Value: MBS( "Matrix.GetValue"; $matrix; 0; 0 ) ]
Set Variable [ $d2 ; Value: MBS( "FM.DataType"; $v2) ]
# stop here to read in debugger
# $d1 shows text and $d2 shows number as type
Set Variable [ $v2 ; Value: MBS( "Matrix.Release"; $matrix) ]
See also
Release notes
- Version 12.5
- Added Matrix.ConvertDataType function.
Blog Entries
- New in MBS FileMaker Plugin 14.0
- Top 10 from the MBS Plugin in 2022
- MBS FileMaker Plugin 12.5 News
- Neues MBS Plugin 12.5 für Claris FileMaker
- MBS Plugin 12.5 for Claris FileMaker - More than 6800 Functions In One Plugin
- MBS FileMaker Plugin, version 12.5pr3
- CSV in FileMaker with MBS FileMaker Plugin
This function checks for a license.
Created 9th October 2022, last changed 9th October 2022