justAnIntern Posted June 24, 2010 Share Posted June 24, 2010 Hello, i implemented the folowing lines of code: ( defun c:areas (/ ft_sqr) (setq ft_sqr (getreal "\nenter an area in sqr feet: ")) (setq acre (/ ft_sqr 43560)) (rtos acre 2 2); (princ " ACRES") ) the output is ACRES" ACRES" is there any reason why the rtos command doest not show the output of the variable, acre? why is it outputing ACRES twice? also, why are the quotations outputing? Thank You! Quote Link to comment Share on other sites More sharing options...
justAnIntern Posted June 24, 2010 Author Share Posted June 24, 2010 i just noticed a typo. this code is written in autolisp Quote Link to comment Share on other sites More sharing options...
lpseifert Posted June 24, 2010 Share Posted June 24, 2010 (princ (strcat (rtos acre 2 2) " ACRES")) (princ);clean exit Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 24, 2010 Share Posted June 24, 2010 Have a look, this will control against nil values from getreal, etc. (defun c:AREAS (/ SF) (if (setq SF (getreal "\nSpecify area in Square Feet: ")) (princ (strcat "\n" (rtos (/ SF 43560.) 2 2) " ACRES")) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
justAnIntern Posted June 24, 2010 Author Share Posted June 24, 2010 thanx guys, you really helped out alot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.