nil variables

Discussion in 'AutoCAD' started by mnash, Jul 15, 2004.

  1. mnash

    mnash Guest

    can you nil all your variables in one string of text thats only say 10-20 characters long, rather than calling up all your variables in your lisp and setting them to nil?
    I have a lisp that has 22 variables
    thanks all
     
    mnash, Jul 15, 2004
    #1
  2. mnash

    BillZ Guest

    Why not just set them to be local?
    that way when the program finishes, the variables will be nil.

    (defun myprog (/ thisvar thatvar anothervar)



    Bill
     
    BillZ, Jul 15, 2004
    #2
  3. mnash

    Jürg Menzi Guest

    Hi mnash

    Localize your variables, eg:
    (defun MyFunc ( / var1 var2...)
    That sets all vars to nil at the begin of a function.

    Cheers
     
    Jürg Menzi, Jul 15, 2004
    #3
  4. mnash

    ECCAD Guest

    And, IF your program doesn't contain (defun ......,
    just add :
    (setq a nil b nil c nil d nil e nil......)
    (setq aa nil bb nil cc nil dd nil ee nil......)
    .....with your vars as a,b,c,d,e..etc...at the end.

    Bob
     
    ECCAD, Jul 15, 2004
    #4
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.