Cold Help System: Programming: ColdC Reference Manual: Functions: List: listidx()


INTEGER listidx(LIST list, ANY what[, INTEGER origin])

This function returns the position in the list where what exists--starting from origin--or a zero if it does not exist. If origin is not specified it will default to 1. The origin represents where to start searching in the list. If it is a positive number it starts that many elements into the list. If it is a negative number it starts that many elements from the end of the list, and searches backwards--from the end of the list to the start. Examples:

listidx([4, "this", [], 'bar], [])
=> 3
listidx([4, "this", [], "this", 'bar], "this", -1)
=> 4
listidx([4, "this", [], "this", 'bar], "this", -3)
=> 2


delete() | insert() | join() | listgraft() | listlen() | replace() | setadd() | setremove() | sublist() | union() | listidx()


the Cold Dark