Author Topic: List of all variables used in a defun  (Read 5135 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 495
List of all variables used in a defun
« on: April 08, 2014, 02:36:12 AM »
Can we get list of all variables used in a defun ?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List of all variables used in a defun
« Reply #1 on: April 08, 2014, 03:29:23 AM »

Yes.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List of all variables used in a defun
« Reply #2 on: April 08, 2014, 03:49:59 AM »

In VLIDE

Menu : Tools-> Environment Options -> General Options -> Diagnostics : Toggle 6 options ON -> Apply

Make file to test active in vlide.

Menu : Tools-> Check Text In Editor.

That will list Global variables.
To List all Variables comment out the local variable  in the defun declaration / variables list.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

HasanCAD

  • Swamp Rat
  • Posts: 1422

mailmaverick

  • Bull Frog
  • Posts: 495
Re: List of all variables used in a defun
« Reply #4 on: April 08, 2014, 07:24:21 AM »
Thanks Hasan

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List of all variables used in a defun
« Reply #5 on: April 08, 2014, 07:38:39 AM »
You're welcome.

bye!
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: List of all variables used in a defun
« Reply #6 on: April 08, 2014, 09:31:42 AM »

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: List of all variables used in a defun
« Reply #7 on: April 08, 2014, 02:36:58 PM »
http://www.lee-mac.com/quicklocalising.html

Thank you for the recommendation Hasan  :-)

@mailmaverick, I'm glad it helps!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: List of all variables used in a defun
« Reply #8 on: April 10, 2014, 08:03:21 AM »
Ever feel invisible?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: List of all variables used in a defun
« Reply #9 on: April 10, 2014, 08:13:14 AM »
Dang cloaking devices, never can tell when they will spontaneously engage.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ChrisCarlson

  • Guest
Re: List of all variables used in a defun
« Reply #10 on: April 10, 2014, 08:35:08 AM »
Probably a dumb questions here about these variables.

I'm not entirely sure on the purpose of listing all variables used in the define line. I have a few crude lisps I wrote ages ago which work and do not have these variables defined. Is this more of a quick glance to see all the variables I'm using, or does it serve a more specific purpose?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: List of all variables used in a defun
« Reply #11 on: April 10, 2014, 08:48:58 AM »
In a nutshell localizing variables within a function prevents external logic from changing said variables unless access is specifically granted in function declarations.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

mailmaverick

  • Bull Frog
  • Posts: 495
Re: List of all variables used in a defun
« Reply #12 on: April 10, 2014, 01:21:05 PM »
Probably a dumb questions here about these variables.

I'm not entirely sure on the purpose of listing all variables used in the define line. I have a few crude lisps I wrote ages ago which work and do not have these variables defined. Is this more of a quick glance to see all the variables I'm using, or does it serve a more specific purpose?

If you do not localise the variables, your variables and their values remain in the memory even after the lisp has finished its execution. The only danger in such case is that the same named variables (having last values of the lisp) may be used in other lisps or autocad commands or express tools where these variables (already having values) may lead to erroneous results,

However, if you do not localise the variables, the best way is to always initialise them to nil before use within each of your lisp.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List of all variables used in a defun
« Reply #13 on: April 10, 2014, 07:55:45 PM »
Ever feel invisible?

I'm on a few ignore lists I think :)

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: List of all variables used in a defun
« Reply #14 on: April 10, 2014, 08:35:44 PM »
I'm on a few ignore lists I think :)

If you are it's the lister's loss.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst