3.5.1.4.8 List


Description

This function returns the index number in vd where val first occurs. If there is no match, the function returns 0. Note that this function makes an "exact" comparison using the equal (==) operator.

Syntax

int list(double val, dataset vd)

Parameter

val

can be any real number.

vd

a vector, can be a dataset or a column in Origin worksheet.

Return

Returns the index number in vd where val first occurs.

Examples

Example 1

The following function tests whether or not the value 3 exists in column A. If the value exists, variable aa will be the row index of this value. If not, variable aa will be zero.

aa = list(3, col(A));
aa = ;

Example 2

The following script finds the row index of the minimum value in column A.

stats col(A);
aa = list(stats.min, col(A));
aa = ;