justAnIntern Posted June 24, 2010 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
justAnIntern Posted June 24, 2010 Author Posted June 24, 2010 i just noticed a typo. this code is written in autolisp Quote
lpseifert Posted June 24, 2010 Posted June 24, 2010 (princ (strcat (rtos acre 2 2) " ACRES")) (princ);clean exit Quote
alanjt Posted June 24, 2010 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
justAnIntern Posted June 24, 2010 Author Posted June 24, 2010 thanx guys, you really helped out alot Quote
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.