Search in record list

Bengt Kleberg bengt.kleberg@REDACTED
Fri Mar 17 15:12:06 CET 2006


On 2006-03-17 14:59, Inswitch Solutions wrote:
>  
> Hi,
>  
> Does someone know an easy way to search by a field of a record on a list 
> of records?
>  
> For example:
>  [ {process_info, {Id, Pid, QueueLength}}...]
>  
> Find the record with Pid element in the list.

is this what you want:
lists:keysearch(Pid, #process_info.pid, List).


bengt



More information about the erlang-questions mailing list