ItemExtract

Returns the selected item from a list.

Syntax:

ItemExtract (index, list, delimiter)

Parameters:

(i) index the position in list of the item to be selected.

(s) list a string containing a list of items.

(s) delimiter a character to act as a delimiter between items in the list.

Returns:

(s) the selected item.

 

Note: Using -1 as the index will return the last item in the list.

A single item null list ("") is not a valid list.

Example:


DirChange(DirWindows(0))
bmpfiles = FileItemize("*.bmp")
bmpcount = ItemCount(bmpfiles, @TAB)
pos = (Random(bmpcount - 1)) + 1
paper = ItemExtract(pos, bmpfiles, @TAB)
Wallpaper(paper, @FALSE)
Message("ItemExtract","Wallpaper changed to %paper% - not tiled")
See Also:

ItemCount, ItemCountCsv, ItemExtractCsv, ItemInsert, ItemLocate, ItemLocateWild, ItemRemove, ItemReplace, ItemSort, Lists Explained