Logo

Programming-Idioms

History of Idiom 222 > diff from v7 to v8

Edit summary for version 8 by Thomas könig:
New Fortran implementation by user [Thomas könig]

Version 7

2020-04-07, 17:56:46

Version 8

2020-04-15, 15:21:37

Idiom #222 Find first index of an element in list

Set i to the first index in list items at which the element x can be found, or -1 if items does not contain x.

Idiom #222 Find first index of an element in list

Set i to the first index in list items at which the element x can be found, or -1 if items does not contain x.

Extra Keywords
position
Extra Keywords
position
Code
i = findloc(items, x)
if (i == 0) i = -1 ! actually unnecessary in Fortran