TI-89 HomeGames ArchiveTitanium GamesGames How ToProgramsFAQForumTI-89 WikiLinks

Displaying results in a dialog box

 
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming
Author Message
pogo



Joined: 15 Sep 2007
Posts: 6

PostPosted: September 15, 2007 7:19 PM    Post subject: Displaying results in a dialog box Reply with quote

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?
Back to top
View user's profile Send private message
pogo



Joined: 15 Sep 2007
Posts: 6

PostPosted: September 18, 2007 3:28 PM    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic : View next topic  
Post new topic   Reply to topic    Your TI-89 Resource Forum Index -> BASIC Programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Contact Us | Privacy Policy | Disclaimer | Trademarks

Copyright ©2006 All rights reserved.


Free Greeting Cards | Girly Myspace Layouts | Myspace Unblocker |