vl-position

AutoCad AutoLISP Functions

 
vl-position
 
 
 

Returns the index of the specified list item

(vl-position  symbol
list)

Arguments

symbol

Any AutoLISP symbol.

list

A true list.

Return Values

An integer containing the index position of symbol in list; otherwise nil if symbol does not exist in the list.

Note that the first list element is index 0, the second element is index 1, and so on.

Examples

_$ (setq stuff (list "a"
"b" "c" "d" "e"))
("a" "b" "c" "d" "e")
_$ (vl-position "c" stuff)
2