2.2.3.9.60 matrixbase::SetByText

Description

Set the values of a matrix by separated values in a string.

Syntax

int SetByText( LPCSTR pTxt, char cSep = ',', double dMissing = 0 )

Parameters

pTxt
[input] a blog of numbers separated be a token separator and lines by LF or CRLF
cSep
[input] token separator character
dMissing
[input] when token empty of non-numeric, use this value

Return

Return 0 if no error, otherwise < 0 error codes

Examples

EX1

void st(string str="1,2,3\r\n2,3,4\r\n7,8,9\r\n")
{
	matrix<int> mm;
	mm.SetByText(str);
	Worksheet wks = Project.ActiveLayer();
	mm.CopyTo(wks);//default will transpose
}

See Also

matrixbase::SetByVector

Header to Include

origin.h