VectorInt::StringsToValues Method

Overload List

#SignatureDescription
1void StringsToValues(tStrings *aList) const;Convert strings in aList to integers.
2TVecInt *StringsToValues(tStrings *aList, const int ListIndex, const int Index = 0, const int Len = MtxVecEOA) const;Convert strings in aList to integers starting at ListIndex.
3TVecInt *StringsToValues(const DewArray<DewString> &aList) const;
4TVecInt *StringsToValues(const DewArray<DewString> &aList, int ListIndex, int Index = 0, int Len = MtxVecEOA) const;

Overload 1: void StringsToValues(tStrings *aList) const;

Convert strings in aList to integers.

#NameTypeDescription
1aListtStrings *
Remarks:

Convert strings in aList to integers according to the IntPrecision property and store them in the Values array of the calling vector. The TMtxVecBase::Length of the calling vector is set to aList.Count.

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()
{
    TVecInt *a, *b;
    tStringList* Lines;

    CreateIt(a, b);
    Lines = new tStringList();
    a->SetIt(DewArray<int>{1,2,3,4});
    a->Add(1);
    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: VectorInt::ValuesToStrings
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 2: TVecInt *StringsToValues(tStrings *aList, const int ListIndex, const int Index = 0, const int Len = MtxVecEOA) const;

Convert strings in aList to integers starting at ListIndex.

#NameTypeDescription
1aListtStrings *
2ListIndexconst int
3Index = 0const int
4Len = MtxVecEOAconst int
Remarks:

Store them in the Values array of the calling vector from Index to Index+Len-1. The Length property of the calling vector is not changed. If array bounds are overrun and exception is raised.

Examples
#include "MtxStrings.h"
#include "MtxExprInt.h"

using namespace Dew;
using namespace Dew::Math;

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

    Lines = new tStringList();
    a = {1, 2, 3, 4};
    a.Add(1);
    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;
}
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 3: TVecInt *StringsToValues(const DewArray<DewString> &aList) const;

#NameTypeDescription
1aListconst DewArray<DewString> &
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 4: TVecInt *StringsToValues(const DewArray<DewString> &aList, int ListIndex, int Index = 0, int Len = MtxVecEOA) const;

#NameTypeDescription
1aListconst DewArray<DewString> &
2ListIndexint
3Index = 0int
4Len = MtxVecEOAint
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler