TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rude dog on February 04, 2004, 02:59:25 PM
-
What is the 'STR in the statement below?.... I tried changing it to 'ABC (thinking I would get the same results) and the prompt came up as "NO ITS NOT"
but when I run it with the 'STR in the expression.... prompt reads
"YES ITS A STRING"
(defun C:STT ()
(setq TEST "THIS IS A STRING")
(if (= (type TEST) 'STR)
(prompt "YES ITS A STRING")
(prompt "NO ITS NOT")
)
(princ)
)
-
Test (type TEST). What is the result? In your case it is STR. Look at the help file for type. You should find your answer.
-
In AutoLISP every variable is assigned a type according to what is in the variable, for example, if you type:
(setq A "a")
The type of variable A is, is a STRing
(setq A 1)
The type of variable A is, is an INTeger
(setq A 1.0)
The type of variable A is, is a REAL (aka long)
(setq A '(0 1 2)
The type of variable A is, is a LIST
If you have a function and you check it, the value will be:
(setq A C:MYFUNCTION)
The type of variable A is, is an SUBRoutine
Do you get the idea?
-
good enuf thanks :wink:
-
No problem....