VectorInt.SetVal Method

TMtxVecInt SetVal(Int32 Value)

Set calling object element Index to Value.

#NameTypeDescription
1ValueInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if array borders are overrun/underrun.

Indexed: TMtxVecInt SetVal(Int32 Value, Int32 Index, Int32 Len)

Set all calling object elements [Index]..[Index+Len-1] to Value.

#NameTypeDescription
1ValueInt32
2IndexInt32start index
3LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if array borders are overrun/underrun.

Examples
using Dew.Math;
using Dew.Math.Units;

namespace Dew.Examples
{
    void Example()
    {
        TVecInt a;
        MtxVecInt.CreateIt(out a);
        try
        {
            a.SetIt(new int[] {1,2,3,4} );
            a.SetVal(5,2,2);  // a = [1,1,5,5]
        }
        finally
        {
            MtxVecInt.FreeIt(ref a);
        }
    }
}