"Test" into (test)?

Discussion in 'AutoCAD' started by Sage Cowsert, Jan 30, 2004.

  1. Sage Cowsert

    Sage Cowsert Guest

    Say I have a routine called test. How would I turn "Test" into (test) with
    out using if?

    (read "test") = doesn't work

    (test) = works

    (defun test ()
    (alert "This is a test")
    )
     
    Sage Cowsert, Jan 30, 2004
    #1
  2. (eval (list (read "test"))) will do it.

    Ken Alexander
     
    Ken Alexander, Jan 30, 2004
    #2
  3. Sage Cowsert

    Doug Broad Guest

    (apply (read "test" ) nil)
     
    Doug Broad, Jan 30, 2004
    #3
  4. Sage Cowsert

    Sage Cowsert Guest

    Thanks guys that did the trick. :)

    Have a good friday.
     
    Sage Cowsert, Jan 30, 2004
    #4
  5. Sage Cowsert

    Sage Cowsert Guest

    Ok how now how about the other way around?

    (setq Bob "is cool")

    to read > "Bob is cool"

    ?? (strcat (read bob) bob) ??
     
    Sage Cowsert, Jan 30, 2004
    #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.