稍微好一点。。。。
- (defun _StepThrough (lst / chars integer position values variables)
- ;;; Tharwat 19. May. 2012 ;;;
- ;;; divide a list of strings that contain commas within ;;;
- (if (eq (type lst) 'STR)
- (setq chars (vl-string->list lst)))
- (if (eq (car chars) 44)
- (setq lst (substr lst 2 (strlen lst))))
- (if (eq (last chars) 44)
- (setq lst (substr lst 1 (1- (strlen lst)))))
- (setq lst (strcat lst ",") integer 0)
- (while (setq position (vl-string-search "," lst 0))
- (if (setq values (cons (set (read (strcat "a" (itoa (setq integer (1+ integer)))))
- (substr lst 1 position)
- )
- values
- )
- )
- (setq variables (cons (strcat "a" (itoa integer)) variables))
- )
- (setq lst (substr lst (+ position 2) (strlen lst)))
- )
- (print (reverse variables))
- (print (reverse values))
- (princ)
- )
|