Madruga_SP Posted May 29, 2013 Posted May 29, 2013 I'm trying to linking a string with real value that is in a variable, but is giving error. Can you help me? The little lisp only divides two numbers and displays the prompt informed with the mark. (defun c: split () (setq n1 (getreal "\ nPlease enter the first value ...:"); First value n2 (getreal "\ nEnter the second value ...:"); According Value result (/ n1 n2); Results of n1 divided by n2 realstring (rtos x result)); convert the result that is real to string result2 (strcat "Result:" realstring);link texts (print result2); displaying the value ) Thank in advance Quote
Lee Mac Posted May 29, 2013 Posted May 29, 2013 (defun c:split ( / m n ) (if (and (setq m (getreal "\n1st value:")) (setq n (getreal "\n2nd value:")) ) (princ (strcat "\nResult: " (rtos (/ m n) 2))) ) (princ) ) Quote
MSasu Posted May 30, 2013 Posted May 30, 2013 Madruga_SP, in order to see the issues in your code: (defun [color=red]c:split[/color]() (setq n1 (getreal "\ nPlease enter the first value ...:"); First value n2 (getreal "\ nEnter the second value ...:"); According Value result (/ n1 n2); Results of n1 divided by n2 realstring (rtos [color=red][s]x[/s][/color] result)[color=red][s])[/s][/color]; convert the result that is real to string result2 (strcat "Result:" realstring)[color=red])[/color];link texts (print result2); displaying the value ) 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.