pogo
Joined: 15 Sep 2007 Posts: 6
|
Posted: September 15, 2007 7:19 PM Post subject: Displaying results in a dialog box |
|
|
I can't figure this out for the life of me. My programming experience is limited, to say the least, so please bear with me.
Ok, so I've been trying to put together a program to do a series of simple calculations based on a few inputs and display the results. For aesthetic reasons I've been trying to do this via dialog boxes and for whatever reason I cannot get the result to display in the box. Here's the basic form of the code:
| Code: |
Dialog
Request "number 1",a
Request "number 2",b
EndDlog
expr(a)->a
expr(b)->b
Define c=a+b
Dialog
Text "the result is ",c
EndDlog
|
The second to last line, Text "the result is ",c is the obvious problem; it doesn't work. I can start the program and enter the a and b values, but then it just gives me the message "Invalid in Dialog..EndDlog block". Trying to substitute Disp for Text gives the same error, but then it pops up right away, the program won't even start. I tried making c a string value just for the hell of it, but I can't get that to work either.
I'm sure there is a way to get a variable value to display in a dialog box, but I can't figure it out. Help? |
|
pogo
Joined: 15 Sep 2007 Posts: 6
|
Posted: September 18, 2007 3:28 PM Post subject: |
|
|
I found the answer, if anybody is interested. Turns out variable c did in fact need to be a string value, but I also needed to change the comma to an ampersand.
So the final line of code is:
| Code: | | Text "The result is "&string(c) |
|
|