Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

lindex

lindex( 
l_list 
g_element 
[ ?all g_all ]
) 
=> x_result / l_result / nil

Description

Returns the index number of the given element in l_list.

Arguments

l_list

A list of elements.

g_element

The element to be searched in l_list.

?all g_all

Specifies whether to print the index number for all occurrences of g_element.

Value Returned

x_result

The index number of g_element in l_list when ?all is either nil or not specified.

l_result

The list of index numbers for all occurrences of g_element in l_list when ?all is set to t.

nil

When the given element is not found in l_list.

Examples

lindex('(1 2 3 4) 2)
=> 2
lindex('(1 4 6 7 4 8 4) 4 ?all t)
=>(2 5 7)
lindex('(1 4 6 7 4 8 4) 4 ?all nil)
=>2

Related Topics

list


Return to top
 ⠀
X