Jump to content
bijoyvm

Cond.. code is not working

Recommended Posts

bijoyvm

hi friends please help me to correct this code...:?

 

;;;;;;; if a is integer

 

(defun C:test()

(setq a 01)

 

(cond

((= (type a) STR) (alert "\nIT IS STRING"))

((= (type a) int) (alert "\nIT IS INTEGER"))

)

(princ)

)

 

;;;;;;;;;; if a is string

 

(defun C:test()

(setq a "PLOT-01")

 

(cond

((= (type a) STR) (alert "\nIT IS STRING"))

((= (type a) int) (alert "\nIT IS INTEGER"))

)

(princ)

)

Share this post


Link to post
Share on other sites
pBe

 
(cond
((= (type a) 'STR) (alert "\nIT IS STRING")) 
((= (type a) 'int) (alert "\nIT IS INTEGER")) 
)

 

Did you not read the other replies on your post a while back? --- > Convert Real to String

 

BTW: ADD CODE TAGS ---> Code Posting Guidelines

Share this post


Link to post
Share on other sites
bijoyvm

thank you so much pBe

yes i read that .. actually I 'm trying to create a lisp and i need to add this condition but it was not working.. no its working perfectly.

 

thanks and regards

bijoy

Share this post


Link to post
Share on other sites
pBe
thank you so much pBe

yes i read that .. actually I 'm trying to create a lisp and i need to add this condition but it was not working.. no its working perfectly.

 

thanks and regards

bijoy

 

Glad to be of service. :)

 

BUT you still need to ADD CODE TAGS ---> Code Posting Guidelines

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×