Admin Production ni-theme
Current Publication

ListGetPtrToItem

LabWindows/CVI

ListGetPtrToItem

void *ListGetPtrToItem (ListType list, ssize_t itemPosition);

Purpose

This function returns a pointer to the specified item in the list.

The pointer is only valid until the next operation which modifies the list occurs.

This function is provided for convenience of being able to examine a list item without copying it out of the list.

Parameters

Input
Name Type Description
list ListType The list from which to retrieve a pointer to specified item.
itemPosition ssize_t The position of the item to retrieve a pointer to. The position can be a number from 1 to the number of items in the list. Positions in the list are one-based.

To get a pointer to the first item in a list, pass -1 or the constant FRONT_OF_LIST.

To get a pointer to the last item in a list, pass 0 or the constant END_OF_LIST.

Return Value

Name Type Description
itemPointer void * Returns a pointer directly to the item stored in the list.

The pointer is only valid until the next operation that modifies the list occurs.

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Examples

Refer to the following examples that use the ListGetPtrToItem function:

  • apps\uirview\uirview.cws

    Open example
  • TDM Streaming\tdmsReader.cws

    Open example
  • toolbox\list.cws

    Open example
  • userint\custctrl\cviogl\ogldemo.cws

    Open example