Skip to content

libcURL.ListPtr.Item

Andrew Lambert edited this page Nov 26, 2022 · 14 revisions

Method Signature

 Function Item(Index As Integer) As String

Parameters

Name Type Comment
Index Integer The index of the string to get. The first item is at Index 0

Return value

A copy of the string at Index.

Remarks

If the list does not contain a string at Index (or the list is empty,) an OutOfBoundsException will be raised. If the next item in the list is invalid, a NilObjectException will be raised.

Performance considerations

Each invocation traverses the list from 0 to Index. As such, the execution time to scan the entire list rises exponentially with the number of items. It is much, much faster to convert the list into a string array, and then use Xojo's built-in array manipulation methods to scan the list.

Syntax example

  Dim lst As libcURL.ListPtr = Array("Hello", "world", "!")
  For i As Integer = 0 To lst.Count - 1
    MsgBox(lst.Item(i))
  Next

See also

Clone this wiki locally