(defun txterr(s) (if (and (/= s "console break") (/= s "Function cancelled") (/= s "quit / exit abort") ) (princ (strcat "\nError:" s)) ) (if olderr (setq *error* olderr)); 恢复原系统设置 (if oldcmd (setvar "cmdecho" oldcmd)) (princ) ) ; 对话框显示及驱动程序 (defun diag ( / i) (if (> (setq dcl_id (load_dialog "#txt")) 0);加载对话框文件 (progn (if (new_dialog "filetext" dcl [JX*6]id); 显示对话框 (progn start_list "what");将词组显示到列表框内 (mapcar 'add_list txt_tb ) (end_list) (setq i 1) (repeat nn;点取词组分类项后的操作 (action_tile (strcat "c" (itoa i)) "(wr_txt)") (setq i (1+ i)) ) (action_tile "what" "(setq i (atoi $value));选中词组 (setq txt (nth i txt_tb))(set_tile \"sel_ok\" txt)" ) (action_tile "sel_ok" "(setq txt $value)") (action_tile "accept" "(setq ok T)(done_dialog 1)(unload_dialog dcl_id)") (action_tile "cancel" "(unload_dialog dcl_id)") (start_dialog) ) (prompt "\n无法显示对话框FILETEXT! 请检查对话框内容!") ) ) (prompt "\n无法加载对话框文件#TXT.DCL! 请检查文件是否存在及路径是否正确!") ) ) ; 初始化程序, 把第1个分组项中的词组读入表txt_tb中 (defun init( / fname fp txt1) (setq fname (findfile "$txt1.dat")) (if (not fname) (progn (princ "\n文件 $TXT1.DAT 不存在 !") (exit)) ; 文件不存在, 则退出 |