STK X Send comments on this topic.
Range Method (AgObjPathCollection)
See Also  Example
StartIndex
Start position of the range. one represents the first element of the collection.
StopIndex
End position of the range. The Count property represents the last element of the collection.





Description

Return the elements within the specified range.

Syntax

[Visual Basic .NET]
Public Function Range( _
   ByVal StartIndex As Integer, _
   ByVal StopIndex As Integer _
) As System.Array

[C#]
public System.Array Range(
int StartIndex,
int StopIndex
);

[Managed C++]
public: System::Array Range(
int StartIndex,
int StopIndex
);

[Java]
public Object[] range(
int StartIndex,
int StopIndex
);

[Unmanaged C++]
public: HRESULT Range(
long StartIndex,
long StopIndex,
SAFEARRAY ** Array
);

Parameters

StartIndex
Start position of the range. one represents the first element of the collection.
StopIndex
End position of the range. The Count property represents the last element of the collection.

Return Type

Array of variants [COM] or objects [.NET].

Remarks

The purpose of this method is to avoid marshalling round-trips (marshalling occurs when the STK X controls are used in .NET or Java).

If the collection contains lots of elements, iterating using the For Each statement or the Item method may be slow. Using the Range method enables you to transfer several elements in one round-trip improving performance.

Example

[Visual Basic .NET] Copy Code
Dim msg As String

Dim objects As Object

objects = pickInfo.ObjPaths.Range(1, pickInfo.ObjPaths.Count - 1)

For Each obj In objects
    msg = msg & " " & obj & vbCrLf
Next obj

MessageBox.Show(msg)

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1