明经通道 AutoLISP 函数  
write-line
 

将字符串写到屏幕上或一个已打开的文件中

(write-line string [file-desc]) 

参数

string

字符串型。

file-desc

已打开文件的文件描述符。

返回值

带有双引号的 string。但将字符串写入到文件中时会省略双引号。

示例

打开新文件:

命令: (setq f (open "c:\\my documents\\new.tst" "w"))

#<file "c:\\my documents\\new.tst">

使用 write-line 将一行文本写入文件:

命令: (write-line "To boldly go where nomad has gone before." f)

"To boldly go where nomad has gone before."

在关闭文件以前该行文本不会被真正写入文件:

命令: (close f)

nil

明经通道 版权所有 未经许可 不得传播

 评论