Computer Science Canada Textbox Assistance Required |
Author: | l3eater [ Fri Jan 08, 2010 11:20 pm ] | ||
Post subject: | Textbox Assistance Required | ||
What is it you are trying to achieve? Instead of using the put statement to output the answer, I want to use a Textbox, more for User Friendliness. Since when I use the put statement, it doesn't have boundaries, and would screw with the other buttons I have aligned with it. Like, I creates an entire white line across where I have located the answer to appear. What is the problem you are having? The Textbox field doesn't accept variables with an int or real statement Describe what you have tried to solve this problem Using if statements within the Textbox. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1 |
Author: | Ktomislav [ Sat Jan 09, 2010 12:21 pm ] | ||
Post subject: | Re: Textbox Assistance Required | ||
GUI.AddText accepts only string so you have to convert your total: real variable to string. To achieve this you can use a function called erealstr. Copied from Turing Documentation. erealstr (r : real, width, fractionWidth, exponentWidth : int) :string So for you it would be something like this:
Hope this helps. |
Author: | l3eater [ Sat Jan 09, 2010 3:22 pm ] |
Post subject: | Re: Textbox Assistance Required |
Thanks! Though, the one you suggested wasn't the one I wanted. The one I wanted was realstr, which mostly keeps the total the same. Thanks Again! ![]() |