您好,CadTutor用户,
我通过lisp ini文件读取(ini\u read“Myfile.ini”“OPTIONS”“Name1”)。
我的文件。ini:
- [OPTIONS]
- Name1=10
- Name2=210
- Name3=0
这将很好地返回我“10”。
问题是,我想对ini文件进行注释,但不需要在结果中进行注释:
[选项]
名称1=10“注释1”
名称2=210“注释2”
名称3=0“注释3”
有人可以编辑我的代码吗?
如果注释以/comment或#comment或…
Lisp代码:
- (defun ini_read (inifile section entry )
- (if (and (= 'STR (type section)) (/= "[" (substr section 1 1))) (setq section (strcat "[" section "]")))
- (setq section (ini_readsection inifile section))
- (cadr (assoc entry section))
- )
- (defun ini_readsection (inifile section / ofile line result )
- (if (and (= 'STR (type section)) (/= "[" (substr section 1 1))) (setq section (strcat "[" section "]")))
- (if (findfile inifile)
- (cdr (assoc section (ini_readini (findfile inifile))))
- (alert (STRCAT inifile "\nNiet Gevonden!"))
- )
- )
谢谢你阅读我的问题
克里斯蒂娜 |