Jump to content

Recommended Posts

Posted

What is the difference between

'symbol and "myName" when used in LISP routines?I always use the quoted version but I see the 'version more often used in samples. Are they interchangable?

Posted

Some AutoLISP functions, (such as setvar / getvar / vlax-get / vlax-get-property / vlax-put / vlax-put-property / vlax-invoke / vlax-invoke-method), will accept both a quoted symbol or a string; in general, a quoted symbol and string are two different data types.

 

_$ (type 'symbol)
SYM
_$ (type "symbol")
STR

Posted

so if you are referencing an inbuilt variable you should be using 'symbol although it will work as "symbol".

Posted
so if you are referencing an inbuilt variable you should be using 'symbol although it will work as "symbol".

 

It makes no difference whichever is used, both are 'correct' :)

(getvar 'cmdecho)
(getvar "cmdecho")

 

I tend to use a quoted symbol as a personal preference (and because its easier to type).

Posted

I'll continue with the "quote marks" then as its an old habbit.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...