还有一个问题
我试着改变一下你的函数,写多行
- (defun nullchartest ( str txt / fso stm )
- (if (setq fso (vlax-create-object "scripting.filesystemobject"))
- (progn
- (vl-catch-all-apply
- '(lambda ( )
- (setq stm (vlax-invoke fso 'createtextfile txt -1 0))
- (vlax-invoke stm 'write (strcat str (chr 256)))
- (vlax-invoke stm 'write (strcat "text for line 2" (chr 256))) ;;;;;changes
- (vlax-invoke stm 'close)
- )
- )
- (if (= 'vla-object (type stm))
- (vlax-release-object stm)
- )
- (if (= 'vla-object (type fso))
- (vlax-release-object fso)
- )
- (findfile txt)
- )
- )
- )
但在结果中它只写了一行(第一行),为什么? |