- ;;;_$ (p-ini-read "D:\\Profile\\desktop\\新建文本文档.ini")
- ;;;(("LL" "1.2") ("WW" "1.5") ("RR" "3.0") ("TT" "5.0") ("......"))
- (defun p-ini-read (filename / file line content)
- (if (and (setq filename (findfile filename))
- (setq file (open filename "r"))
- )
- (progn
- (while (setq line (read-line file))
- (if (and (setq line (vl-string-trim " \t\n" line))
- (/= line "")
- (/= (p-string-left line 1) ";")
- (/= (p-string-left line 2) "\\\\")
- (setq line (p-string-tokenize line "="))
- )
- (setq line (mapcar '(lambda (e) (vl-string-trim " \t\n" e)) line)
- content (cons line content)
- )
- )
- )
- (close file)
- (reverse content)
- )
- )
- )
|