Basic argument

Discussion in 'AutoCAD' started by Adesu, Jul 6, 2004.

  1. Adesu

    Adesu Guest

    Why expert programer,if he write program lisp,like it below
    (setq ocmd (getvar "cmdecho") oblip (getvar "blipmode"))
    (setvar "cmdecho" 0)
    (setvar "blipmode" 0)
    why not like this >>>(setq ocmd 0 oblip 0).
    Can you explain to me ,what basic argument you write like above.
    Best regards
    Ade Suharna
    ;--------------------------------------------
    Command: setvar
    Enter variable name or [?] <CMDECHO>: ?
    Enter variable(s) to list <*>: *
    BLIPMODE 0
    CDATE 20040706.15103988 (read only)
    CECOLOR "BYLAYER"
    CIRCLERAD 0.0000
    CLAYER "DATESTAMP"
    CMDACTIVE 1 (read only)
    CMDDIA 1
    CMDECHO 0
    CMDNAMES "SETVAR" (read only)
     
    Adesu, Jul 6, 2004
    #1
  2. Adesu

    zeha Guest

    it saves the value of the variable and if the function has done restore it, because you don't now the value of these

    In case blipmode
    it's possible that a different user has turned on the blipmode (1)
    when your program runs, it display anywhere a 'blip'

    thats why the blipmode is set to 0

    hope this helps

    see also the layer variable "clayer"
    this can a lot of different names.
     
    zeha, Jul 6, 2004
    #2
  3. Adesu

    Joe Burke Guest

    Adesu,

    I'm not sure what the question is given your example. But if the question is, why
    does setq allow multiple arguments while setvar does not... see Developer Help
    regarding these functions.

    this:
    (setq a b)
    (setq c d)
    is the same as:
    (setq a b c d)

    but you cannot do this:
    (setvar "cmdecho" 0 "blipmode" 0)
    because setvar expects a single variable name and a value.

    Joe Burke
     
    Joe Burke, Jul 6, 2004
    #3
  4. Adesu

    Adesu Guest

    Hi zeha and Joe,thanks a lot for yours reply

     
    Adesu, Jul 9, 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.