View Full Version : listing global variables
bowtle
2009-07-05, 12:19 AM
When a program finishes is there a way to list any variables still defined?
If my memory serves me correctly many moons ago you could use !atomlist at the command prompt and it would list all variables still defined.
Because I am BAD at writing lisp, the vast majority of my programs use global variables, now I would like to change them to local variables and do not really want to manually search through the code to find them.
Your help will be greatly appreciated
d_m_hopper
2009-07-05, 02:39 PM
I forget how I got to the setting, but under regedit, I changed my filterfile to 1
this allows me to search my lisp folder for strings within the files.
So once you ID the global variables, you could search for them this way...if you think you might have used the same naming convention...
rkmcswain
2009-07-05, 02:43 PM
Here is one way to find the global variables in your code....
http://cadpanacea.com/node/35
devitg.89838
2009-07-06, 12:29 AM
When a program finishes is there a way to list any variables still defined?
If my memory serves me correctly many moons ago you could use !atomlist at the command prompt and it would list all variables still defined.
Because I am BAD at writing lisp, the vast majority of my programs use global variables, now I would like to change them to local variables and do not really want to manually search through the code to find them.
Your help will be greatly appreciated
If you use the vlide you can get it easy, do a CHECK TEXT
CTRL+Alt+C , it will you a list of all global variables in each defun , and needed arguments
.
; === Top statistic:
; Global variables: (3D-POLY 3D-POLY-ENT-EXPLODED-LIST 3D-POLY-OBJ 3D-POLY-OBJ-EXPLODED-LIST 3DPIPE+ELLBOW :vlax-false :vlax-true acByLayer acRed ARC+LIN-LIST ARC+LIN-SS CONT ENT00 ENT01 EXPL EXPL-LAY FILLET-RAD LINES-QTY OLD-FILLET-RAD OLD-TRIMMODE PIPE PIPE+ELLBOW-SS)
; Function definition (with number of arguments): ((FILLET-3DPOLY . 0))
.
; === Top statistic:
; Global variables: (BLOCK-COLL BLOQUE BLOQUE-LAYER BLOQUE-OBJ BLOQUES-LIST BLOQUES-QTY BLOQUES-SS INSERT UNICOS UNICOS-QTY)
; Function definition (with number of arguments): ((SELECCIONA-Y-CAMBIA-NOMBRE . 0))
.
; === Top statistic:
; Global variables: (P1 P2 POLY-LIST POLY-SS)
; Function definition (with number of arguments): ((SELECCIONO-POLYS . 0))
.
; === Top statistic:
; Global variables: (COUNT)
; Function definition (with number of arguments): ((CANT-IGUALES . 2))
bowtle
2009-07-08, 03:14 AM
Thanks guys, your help is much appreciated
ccowgill
2009-07-08, 12:44 PM
Here is one way to find the global variables in your code....
http://cadpanacea.com/node/35
That is an awesome tip. It is very annoying to do it manually, scroll down, scroll back up type the variable in, scroll back down, scroll back up, you get the picture...
bowtle
2009-07-09, 06:08 AM
That is an awesome tip. It is very annoying to do it manually, scroll down, scroll back up type the variable in, scroll back down, scroll back up, you get the picture...
I agree, after changing the setting as in the post by rkmcswain the ctrl alt c as posted by devitg.89838 works too ;)
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.