eval ?

Discussion in 'AutoCAD' started by MRL, Aug 10, 2003.

  1. MRL

    MRL Guest

    Hello,

    i'm trying to set several functions (my functions) to nil
    When i typ:

    (setq @command "C:bl")
    (eval (read (strcat "(setq " @command " nil)")))

    ---> it works.(routine "c:bl" is not available)


    But when i'm putting it inside a function it won't work !

    (defun vlm:SettoNil (@command)
    (eval (read (strcat "(setq " @command " nil)")))
    )

    ---> (my routine "c:bl" is still available)


    Can anybody help me! Please.

    Martin
     
    MRL, Aug 10, 2003
    #1
  2. MRL

    David Bethel Guest

    Try something a little simplier:

    (set (read @command) nil)

    -David
     
    David Bethel, Aug 10, 2003
    #2
  3. MRL

    David Bethel Guest

    Straight from my A2K command line:

    Command: (defun c:myfoo () (princ))
    C:MYFOO

    Command: !c:myfoo
    #<SUBR @01dcbd0c C:MYFOO>

    Command: (set (read "c:myfoo") nil)
    nil

    Command: !c:myfoo
    nil


    Must be some else. How are the functions defined in the first place?
    -David
     
    David Bethel, Aug 10, 2003
    #3
  4. MRL

    David Bethel Guest

    Martin

    Thats OK

    The correct syntax would have been

    (eval (list setq (read @command) nil))

    -David
     
    David Bethel, Aug 11, 2003
    #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.