last_is attribute

The field attribute [last_is] specifies the index of the last array element to be transmitted. When the specified index is zero or negative, no array elements are transmitted.

[last_is( limited-expression-list )]



Specifies one or more C-language expressions. Each expression evaluates to an integer that represents the array index of the last array element to be transmitted. The MIDL compiler supports conditional expressions, logical expressions, relational expressions, and arithmetic expressions. MIDL does not allow function invocations in expressions and does not allow increment and decrement operators. Separate multiple expressions with commas.


The [last_is] attribute determines the value of the array index corresponding to the [length_is] attribute when [length_is] is not specified. The relationship between these array indexes is as follows: length = last - first + 1.

If the value of the array index specified by [first_is] is larger than the value specified by [last_is], zero elements are transmitted.

The [last_is] attribute cannot be used as a field attribute at the same time as the [length_is] attribute or the [string] attribute.

Using a constant expression with the [last_is] attribute is an inappropriate use of the attribute. It is legal, but inefficient, and will result in slower marshaling code.

When the value specified by [max_is] is equal to or greater than zero, the following relationship must be true: 0 <= last_is <= max_is.


    [in] short Last,
    [in, last_is(Last)] short asNumbers[MAXSIZE]);

See also

Field Attributes


Interface Definition (IDL) File