Attila The Gel Posted September 13, 2012 Share Posted September 13, 2012 (edited) Hi, Can some one show me how I can get the below code to work? I cant seem to return a result of formula to an edit box. as you can see from the code snip below, when I type a real number in edit box 1 I would like to get the sum of edit box 1 and 154 to edit box 2. and the same with edit box 2 but then minus 154. (action_tile "eb1" [indent][indent]"(setq eb1 $value) (set_tile \"eb2\" (+ eb1 154)") ;NOT WORKING [/indent] [/indent](action_tile "eb2" [indent][indent]"(setq eb2 $value) (set_tile \"eb1\" (- eb2 154)") ;NOT WORKING [/indent] [/indent] thanks Edited September 13, 2012 by Attila The Gel Solved Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 13, 2012 Share Posted September 13, 2012 edit_box tiles use strings and tile keys should also be strings, not symbols, hence I would suggest: (action_tile "eb1" "(set_tile \"eb2\" (if (setq eb1 (distof $value)) (rtos (+ eb1 154)) \"N/A\"))") (action_tile "eb2" "(set_tile \"eb1\" (if (setq eb2 (distof $value)) (rtos (- eb2 154)) \"N/A\"))") Quote Link to comment Share on other sites More sharing options...
Attila The Gel Posted September 13, 2012 Author Share Posted September 13, 2012 Thx Lee Mac, thats almost perfect. Just that the result is with precision 0.0000 what do i need to change in order to get a rounded number. if eb1 = 2000 then eb2 = 2145 and not 2145.0000. thx again its nice to know that you still rock here ! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 13, 2012 Share Posted September 13, 2012 Just that the result is with precision 0.0000 what do i need to change in order to get a rounded number. Read the documentation on the rtos function its nice to know that you still rock here ! Cheers dude! Quote Link to comment Share on other sites More sharing options...
Attila The Gel Posted September 13, 2012 Author Share Posted September 13, 2012 Read the documentation on the rtos function Just read it and problem solved. I may have some new questions as I'm trying to learn Lisp and DCL until my lisp programming lessons start on 10/10. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 13, 2012 Share Posted September 13, 2012 No problem Attila, ask away 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.