CreateModelIterator: IMatrixModelIterator;
The CreateModelIterator method creates an iterator that is used to navigate the matrix.
Sub UserProc;
Var
M: Matrix[2];
Mm: IMatrixModel;
Iter: IMatrixModelIterator;
I, J: Integer;
Begin
For i := 0 To 10 Do
For j := 0 To 10 Do
M[i, j] := Math.RandBetweenI(0, 9);
End For;
End For;
Mm := M As IMatrixModel;
Iter := Mm.CreateModelIterator;
Iter.Move(IteratorDirection.First);
Debug.WriteLine("View matrix in iterator:");
While Iter.Valid Do
Debug.Write(Iter.Value + " ");
Iter.Move(IteratorDirection.Next);
End While;
End Sub UserProc;
After executing the example a matrix containing random values will be created. An iterator will be obtained on the basis of this matrix, and all the matrix values will be displayed in the development environment console.
See also: