52
156
104
后起之秀
使用道具 举报
114
1万
中流砥柱
(setq des (open "C:\\MyTextFile.txt" "w"))(write-line "This is a test." des)(close des)
(defun c:writetextfile ( / des txt ) ;; Define function, declare local variables (if (setq txt (getfiled "Create Text File" "" "txt" 1)) ;; Prompt user for filename/filepath (if (setq des (open txt "w")) ;; Attempt to create text file with given filename/filepath (progn ;; Evaluate the enclose expressions as the 'then' expression for the IF statement (write-line "This is a test." des) ;; Write line of text to text file (close des) ;; Close file descriptor ) ;; end PROGN (princ "\nUnable to create text file.") ;; Else the text file could not be created ) ;; end IF (princ "\n*Cancel*") ;; Else the user pressed Cancel ) ;; end IF (princ) ;; Suppress the return of the last evaluated expression) ;; end DEFUN
(setq StrRx (open "C:\\WCcharset.txt" "w"))(write-line p+ StrRx)(close StrRx)
(if (setq des (open "C:\\test.txt" "w")) (progn (write-line "testing" des) (close des) ) (princ "\nUnable to create/modify test.txt."))
本版积分规则 发表回复 回帖后跳转到最后一页
微信公众平台
扫描访问手机版
点击图片下载手机App
|关于我们|小黑屋|乐筑天下 繁体中文
GMT+8, 2025-3-11 06:43 , Processed in 0.781005 second(s), 73 queries .
© 2020-2025 乐筑天下
在线时间:10:00-17:00
暂无
扫一扫,关注我们
帮助中心
关于我们
下载APP客户端