明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1597|回复: 0

[函数] 高手来看下,变动变量的局部变量设置问题

[复制链接]
发表于 2009-12-14 16:58:00 | 显示全部楼层 |阅读模式

(defun Split (str bi-i)
 (setq j (vl-string-position (ascii "值") str)
       k (vl-string-position (ascii " ") str)
       sz (substr str (+ 3 j) (- k j 2))
                 );setq
   (set  (read(strcat "bl-" (itoa bl-i))) (substr str 1 j))
   (set (read(substr str 1 j)) (atof sz))
  (setq j nil
 k nil
 sz nil);setq 清零
        )
;**********赋值****
(defun c:rea()
(setq datefile(getfiled "选择钢管杆的信息文件" "C:/Documents and Settings/Administrator/桌面/" "txt" 2))
  (setq ff(open datefile "r"))                    
  (setq bl-i 1)                       
(while (setq line (read-line ff))
  (split line bl-i)
  (setq bl-i (+ 1 bl-i))
  );while
  (close ff)
  (clear)
  )
;***********************
(defun clear()
  (setq i 1)
(while (< i bl-i)
  (setq bl-x  (strcat "bl-" (itoa i)))
  (set (read(read bl-x)) nil);----------------这里,例如bl-1="1d-skj",能不能通过2次的read 把1d-skj=nil呢。
  (setq i (1+ i))
  )
  (setq bl-i nil)
  )

我的思路就是bl-1=“1d-skj” 那么read bl-1=1d-skj 从而令1d-skj=nil

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-1 21:33 , Processed in 0.172445 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表