;; | ----------------------------------------------------------------------------- ;; | TX_Lst2File ;; | ----------------------------------------------------------------------------- ;; | Function : Write a list of strings into a file. After the file is written, ;; | it is closed. ;; | Arguments: 'fn' - File name ;; | 'Lst'- List of strings to write ;; | 'Mode' - can be either "a" or "w" (append or overwrite) ;; | Returns : 'T' - True if successful, 'nil' if not ;; | Updated : June 26, 2000 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ----------------------------------------------------------------------------- (defun TX_Lst2File( fn Lst Mode / Str Ok fptr tmp cnt ) (setq fptr (open fn Mode) Ok nil ) (if fptr (progn (if #Verbose (princ "\n") ) (setq cnt 0 tmp (strcat " of " (itoa (length Lst))) ) (foreach Str Lst (setq cnt (1+ cnt)) (if #Verbose (princ (strcat "\rWriting file: " fn "..." (itoa cnt) tmp)) ) (write-line Str fptr) ) (close fptr) (setq Ok T) )) Ok )