;; | ---------------------------------------------------------------------------- ;; | LI_CountItem ;; | ---------------------------------------------------------------------------- ;; | Function : Finds out the number of occurences of an element in a list ;; | Argument : [Lst] - the list to be checked ;; | [itm] - the item to be counted ;; | Returns : Number of occurences ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun LI_CountItem( Lst itm / cnt _itm ) (setq cnt 0) (foreach _itm Lst (if (= _itm itm) (setq cnt (1+ cnt))) ) cnt )