TMtxSmallInt::StringsToValues Method

Overload List

#SignatureDescription
1TMtxInt *StringsToValues(tStrings *srcList, const DewString &aDelimiter);Convert strings to integers and store them in the Values array.
2TMtxInt *StringsToValues(tStrings *srcList);Convert strings to integers and store them in the Values array.
3TMtxInt *StringsToValues(tStrings *srcList, int ListIndex, int ListLen, int Row, int Col, DewString Delimiter = kTab);Convert strings from [ListIndex]..[ListIndex+ListLen-1] in srcList to integers.
4TMtxInt *StringsToValues(const DewArray<DewString> &aList, const DewString &Delimiter = kTab);
5TMtxInt *StringsToValues(const DewArray<DewString> &aList, int ListIndex, int ListLen, int Row, int Col, const DewString &Delimiter = kTab);

Overload 1: TMtxInt *StringsToValues(tStrings *srcList, const DewString &aDelimiter);

Convert strings to integers and store them in the Values array.

#NameTypeDescription
1srcListtStrings *
2aDelimiterconst DewString &
Remarks:

Convert strings in aList to integers and store them in to the IValues/SValues/BValues array of the calling matrix. TMtxSmallInt::Rows property is set to aList.Count. TMtxSmallInt::IntPrecision and TMtxSmallInt::Cols propertes are auto-detected. Columns must be separated with a Delimiter. By default the delimiter is the tab charachter.

Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"
#include "MtxStrings.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

void Example()
{
    TMtxInt *a, *b;
    tStringList* Lines;

    CreateIt(a, b);
    Lines = new tStringList();
    a->SetIt(2, 2, DewArray<int>{1,2,3,4});
    b->Size(a);
    b->SetVal(1);
    a->Add(b);
    Lines->Clear();
    a->ValuesToStrings(Lines);
    b->ValuesToStrings(Lines);
    Lines->SaveToFile("Test.txt");
    Lines->LoadFromFile("Test.txt");
    a->StringsToValues(Lines);
    delete Lines;
    FreeIt(a, b);
}
See Also: TMtxSmallInt::ValuesToStrings
Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler

Overload 2: TMtxInt *StringsToValues(tStrings *srcList);

Convert strings to integers and store them in the Values array.

#NameTypeDescription
1srcListtStrings *
Remarks:

The assumed delimiter between columns will be a tab charachter.

Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler

Overload 3: TMtxInt *StringsToValues(tStrings *srcList, int ListIndex, int ListLen, int Row, int Col, DewString Delimiter = kTab);

Convert strings from [ListIndex]..[ListIndex+ListLen-1] in srcList to integers.

#NameTypeDescription
1srcListtStrings *
2ListIndexint
3ListLenint
4Rowint
5Colint
6Delimiter = kTabDewString
Remarks:

Store them in the Values array of the calling matrix, starting from element [Row,Cols]. The size of the calling matrix is not changed. If array bounds are overrun an exception is raised.

Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler

Overload 4: TMtxInt *StringsToValues(const DewArray<DewString> &aList, const DewString &Delimiter = kTab);

#NameTypeDescription
1aListconst DewArray<DewString> &
2Delimiter = kTabconst DewString &
Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler

Overload 5: TMtxInt *StringsToValues(const DewArray<DewString> &aList, int ListIndex, int ListLen, int Row, int Col, const DewString &Delimiter = kTab);

#NameTypeDescription
1aListconst DewArray<DewString> &
2ListIndexint
3ListLenint
4Rowint
5Colint
6Delimiter = kTabconst DewString &
Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler