defining a func within another func...

Discussion in 'AutoCAD' started by Devin, Aug 4, 2003.

  1. Devin

    Devin Guest

    O.K. so I've seen people defining a function inside another function or
    command. But what's the purpose? Is it then local to the func it's
    declared in? Can outside funcs access it?

    Thanks,

    Devin
     
    Devin, Aug 4, 2003
    #1
  2. Devin

    Kevin Nehls Guest

    So in the early days declaring them locally was a work around for other
    issues? Memory?
     
    Kevin Nehls, Aug 5, 2003
    #2
  3. Devin

    Devin Guest

    Thanks for the info, it clarifies things for me.

    Devin
     
    Devin, Aug 5, 2003
    #3
  4. Can also be handy if you need the function to work differently based on
    different conditions.I.E. (If A (defun func() Do something one way
    .....)(defun func() Do Something a different way...)).

    Usually it is easier to put the condition in the function itself, but if the
    condition is really complex and/or takes a lot of time to evaluate, then it
    is better to do it once and just define the appropriate function.
     
    Randy Sanders, Aug 5, 2003
    #4
  5. Devin

    Devin Guest

    Didn't think about that, great perspective.

    Devin
     
    Devin, Aug 5, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.