F_VN_AdvanceIterator

F_VN_AdvanceIterator 1:

Advance an iterator by the specified offset.

Syntax

Definition:

FUNCTION F_VN_AdvanceIterator : HRESULT
VAR_INPUT
    ipIterator : ITcVnForwardIterator;
    nOffset    : LINT;
    hrPrev     : HRESULT;
END_VAR

F_VN_AdvanceIterator 2: Inputs

Name

Type

Description

ipIterator

ITcVnForwardIterator

Iterator to be advanced

nOffset

LINT

Offset, by which ipIterator is advanced

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_AdvanceIterator 3: Return value

HRESULT

Further information

The function F_VN_AdvanceIterator increments or decrements an iterator by a certain offset nOffset.

If the offset nOffset is always to be 1, the simpler function F_VN_IncrementIterator can also be used.

Parameter

Iterator

The parameter ipIterator is of the type ITcVnForwardIterator. Since ITcVnBidirectionalIterator and ITcVnRandomAccessIterator inherit from it, these can also be transferred to the function. If a forward iterator is to be decremented, an internal attempt is made to transform it into a bidirectional iterator and to decrement it.

Offset

The offset nOffset defines by how much the iterator ipIterator is to be incremented or decremented. If nOffset > 0 it is incremented; if nOffset < 0 it is decremented.

Related functions

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision