Author Topic: 'STR  (Read 3576 times)

0 Members and 1 Guest are viewing this topic.

rude dog

  • Guest
'STR
« 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)
)

daron

  • Guest
'STR
« Reply #1 on: February 04, 2004, 03:01:59 PM »
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.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
'STR
« Reply #2 on: February 04, 2004, 03:08:51 PM »
In AutoLISP every variable is assigned a type according to what is in the variable, for example, if you type:
Code: [Select]
(setq A "a")
The type of variable A is, is a STRing

Code: [Select]
(setq A 1)
The type of variable A is, is an INTeger

Code: [Select]
(setq A 1.0)
The type of variable A is, is a REAL (aka long)

Code: [Select]
(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:
Code: [Select]
(setq A C:MYFUNCTION)
The type of variable A is, is an SUBRoutine

Do you get the idea?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

rude dog

  • Guest
'STR
« Reply #3 on: February 04, 2004, 04:20:26 PM »
good enuf thanks :wink:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
'STR
« Reply #4 on: February 04, 2004, 04:21:28 PM »
No problem....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie