flowerrobot 发表于 2022-7-6 12:46:10

懒人局部变量

早上好
昨晚,我意识到我的一个程序中遗漏了几个变量,于是创建了这个。
运行它,然后运行所需的文件,然后再次运行。
将输出您需要的信息和一些不重要的信息
是的,我知道这并不难,看看setq,看看定义了什么,但在4k以上的线路上,你有时会错过一些。
如果喜欢,请使用
 
 
 
;|
Missed Values
Rev 1.0
Created 11-09-09
By FlowerRobot

This is used to work out what a program
leaves behind.
Particualy any varibables missed.

|;
(defun c:MissedValues (/ TheBigList2 LeadProgn SubFuncts Prognvarible OtherVar)
(setvar "cmdecho" 0)
(if TheBigList1
(progn
(alert "\nThis can take a few mins")
(setq TheBigList2 (acad_strlsort (atoms-family 1)))
(foreach it2 TheBigList2
   (if (not (member it2 TheBigList1))
    (cond
   ((wcmatch it2 "C:*")(setq LeadProgn (cons it2 LeadProgn)))
   ((member (type (eval (read it2))) (list 'SUB 'USUBR 'EXRXSUBR))(setq SubFuncts (cons it2 SubFuncts)))
   ((member (type (eval (read it2)))(list 'STR 'USUBR 'INT 'LIST 'REAL 'STR 'VLA-object 'PICKSET))(setq Prognvarible (cons it2 Prognvarible)))
   (t (setq OtherVar (cons it2 OtherVar)))
)))
(setq TheBigList1 nil)
(if LeadProgn(progn
   (princ "\n***** Command Calls **********")
   (foreach it LeadProgn (terpri) (princ it))))
(if SubFuncts (progn
   (princ "\n***** Sub Functions **********")
   (foreach it SubFuncts (terpri) (princ it))))
(if Prognvarible (progn
   (princ "\n***** Variables **********")
   (foreach it Prognvarible (terpri) (princ it))))
(if OtherVar (progn
   (princ "\n***** Other **** **********")
   (foreach it OtherVar (terpri) (princ it))))
(if (not (or LeadProgn SubFuncts Prognvarible OtherVar))
   (princ "\nGood job clean as a whisle\nCreated by FlowerRobot"))
)
(progn
(princ "\nNow run your programs and then run this program again")
(setq TheBigList1 (cons "THEBIGLIST1" (acad_strlsort (atoms-family 1))))
)
)
(setvar "cmdecho" 1)
(princ)
)
变量-V1.0。拉链

wkplan 发表于 2022-7-6 13:36:41

Flowerrobot,这项工作很棒!
 
你就在那一刻发布了它,我计划修改我的一些代码
 
这些使生活变得轻松的功能之一。
 
谢谢分享。
 
当做
沃尔夫冈

Lee Mac 发表于 2022-7-6 13:47:48


 
提示一下,您可以使用VLIDE中的“检查”按钮检查全局变量
 
页: [1]
查看完整版本: 懒人局部变量