ShadyV Posted November 23, 2021 Share Posted November 23, 2021 I have been searching for days. I apologize if this is very basic. I don't know terms or coding at all I just type things in lisps until they do what I want. I don't know how to ask the question so that is probably why I can't find the answer by searching. How do I use the RW value in a command line to draw a line? I want to start the line at 0,0 and end at 0,26. (setq RW 26) ;user set value from dcl (Command "line" "0,0" "0,RW" "") How do I place the RW in there so the result is this? (Command "line" "0,0" "0,26" "") Quote Link to comment Share on other sites More sharing options...
Steven P Posted November 23, 2021 Share Posted November 23, 2021 So... if you put something between " it is read as a string, a fixed thing and no calculation is done to work out what it is. You'll need to write it out so that the LISP knows to evaluate that part. To make a point you can use a list, instead of "0,RW" try (list 0 RW) (Command "line" "0,0" (list 0 RW) "") a second way to do this might be to create a string something like: (setq pt (strcat "0," (rtos RW))) (command "line" "0,0" pt "") Here you are making a text string, pt, since RW is a number (or should be?) you need to convert that to a string to join to another string, which is what RTOS does. The reverse is true, if RW is text, and not a number in my first example you;d need to use ATOF Second note here, (strcat "0," (rtos RW))can be put in place of pt in the second line to make your code a bit shorter. 1 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 23, 2021 Share Posted November 23, 2021 (command "line" "_none" '(0.0 0.0 0.0) "_none" (list 0.0 RW 0.0) "") 2 Quote Link to comment Share on other sites More sharing options...
ShadyV Posted November 23, 2021 Author Share Posted November 23, 2021 Thank you both. All the options work for me! To stay true to my horrible programming style I will chose the most complex way to put this in and keep my code as long and ugly as possible. lol 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.