本帖最后由 Lisper 于 2011-9-25 20:21 编辑
 - ;|
- 假设你的函数为:
- (defun c:ff()
- (setq a (getreal "\n参数1:")
- b (getreal "\n参数2:")
- )
- (princ "\n结果:")
- (princ (* a b))
- (princ)
- )
- 将函数内容去掉 defun c:ff 后赋值给表 FunList ,即
- |;
- (setq FunList
- '(()
- (setq
- a
- (getreal "\n参数1:")
- b
- (getreal "\n参数2:")
- )
- (princ "\n结果:")
- (princ (* a b))
- (princ)
- )
- )
- (setq n 0
- funstr "c:ff"
- NewFun funstr
- )
- (while (car (ATOMS-FAMILY 1 (list NewFun)))
- (setq NewFun (strcat funstr (itoa (setq n (1+ n)))))
- )
- (eval (append (list 'defun (read NewFun)) FunList))
- (princ (strcat "\n启动命令: " (substr NewFun 3)))
|