How about this one.


Code:
:Input "Name:",Str1
:ClrHome
:Disp "Hello",Str1
:Pause
:ClrHome
:Goto CM
:Stop
:Lbl CM
:Axes Off
:ClrDraw:ClrHome
:Text(1,15,"Greencini Chat 2.3 BETA")
:Text(8,8,"1:SEND")
:Text(14,8,"2:RECIEVE")
:Text(20,8,"3:QUIT")
:0→D
:While D=0
:getKey→D
:End
:If D=92
:Goto C1
:If D=93
:Goto C2
:If D=82
:Goto C3
:If D=45
:Goto ST
:Goto CM
:Lbl C1
:ClrHome
:Input Str1,Str2
:Goto CM
:Stop
:Lbl C2
:ClrDraw:ClrHome
:GetCalc(Str1)
:Output1,1,Str1)
:Pause
:Goto CM
:Stop
:Lbl C3
:DelVar Str2:ClrHome
:Stop
:Lbl ST
:Lbl CM
:Stop
There is no reason to "stop" after the Goto statements, since the Stop command would never be reached.

And to once the person wants to "stop", you should use the Return command instead.

Input also does not allow the use for multiple variables, Prompt does, on the other hand.

When using the Delvar command, you do not need a : for the next command, in most cases.

Also, the second to last line is Lbl CM, but it is also at the top of the program, the last one should be removed, since it will never be reached.

You can take off the ending ), they are not needed.
Good progress, but allow me to point out a few things.


Code:
:Goto CM
:Stop
:Lbl CM
What were you trying to do here? That code is meaningless, since you unconditionally jump past a command (the Stop). Eliminate both the Goto and the Stop. Also, you have duplicate label names (Lbl CM). You do this again later in the program:

Code:
:Goto CM
:Stop
:Lbl C2



Code:
:While D=0
:getKey→D
:End
Just an optimization thing - to make this operate faster and better, try:

Code:
:Repeat D
:getKey→D
:End
This will run the loop at least once, then loop until D contains a nonzero value.

A final thing:

Code:
:Lbl C3
:DelVar Str2:ClrHome
:Stop
:Lbl ST
:Lbl CM
:Stop
So, so, so no. There's two things here:
(1) Don't use stop. It breaks compatibility with all ASM shells; use Return instead.
(2) You should eliminate those final two labels and the Stop at the end. They don't serve any purpose as far as I can tell. In the middle, change:

Code:
:If D=45
:Goto ST
to
Code:
:If D=45
:Goto C3
One simple thing tifreak8x and Kerm forgot to mention was that you are using the GetCalc() command incorrectly; it only has one argument: a variable. Besides that, it would probably be good for you to learn about TI-Basic best practices so that you can see how to organize a program, which is actually the most important optimization you can make.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement