Jump to content

Recommended Posts

Posted

Good morning

I created this last night after realising i had missed a few variables on one of my programs.

Run it, Then run the files you want, then run it again.

Will output your necessary information and some that isn't important

Yes i know its not hard to look threw the setq and see whats defined however on 4k+ lines you miss some sometimes.

Use if you like

 

 

 

;|
 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)
)

Variables-V1.0.zip

Posted

Flowerrobot, this work's great!

 

And you posted it just at that moment, I planned to revise some of my code :lol:

 

One of these functions that make life easy.

 

Thankyou for sharing it.

 

regards

Wolfgang

Posted

Flower,

 

Just a tip, you can check for global variables using the "check" button in the VLIDE :thumbsup:

 

ex.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...