;; | ---------------------------------------------------------------------------- ;; | ST_fsrch ;; | ---------------------------------------------------------------------------- ;; | Function : Search for the first location of a character in a string ;; | Argument : 'str' - String to search ;; | 'delim' - Character to search ;; | Return : The numeric first position from start where the specified character ;; | occurs ;; | Updated : February 5, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun ST_fsrch(str delim / len pos more cnt ch) (setq len (strlen str) pos nil more T ) (if (> len 0) (progn (setq cnt 1) (while (and more (<= cnt len)) (setq ch (substr str 1 1) str (substr str 2) ) (if (= ch delim) (setq pos cnt more nil )) (setq cnt (1+ cnt)) ) )) pos )