TBasic for Dummies
Lesson 4 |
Here you are almost a complete programmer for TBASIC. It's been an easy ride right? O.k. Let's start with some more new commands.
The first command is STOP. This is actually really easy to understand. If you put this in a program it will end EVERYTHING. It will stop whatever is running in the backround and foreground. In the end it will look as if you just turned on your calculator. Normally you use this command when you need it to stop instead of looping threw the program. Do I need to make an example of this?
Program Count
:0->A
:LBL 1
:A+1->A
:Disp A
:If (A=100)
:Then
:STOP
:end
:GOTO 1
This is just another way to make a count program that stops at a certain value. The next thing I will show you how to use is the the summon command. If enter the program menu then hit right twice you will see a list of all your current programs. If you click on one of them it will add a prgmSOMETHING into your program. That means that when the program gets to that line it will run that program (an example will be below).
Next is the RETURN command. The return command is used to send the program BACK to the one it was just running. So lets say you ran program count1. In count1 you summoned count2. Then in Count 2 you put a return command in. That would send it Back to count1. Get it? Here's an example...
Prgm Count1
:0->A
:LBL 1
:Disp A
:A+1->A
:If (A=100)
:Then
:prgmCOUNT2
:END
:GOTO 1
Prgm Count2
:lbl 1
:disp B
:B+1->B
:If (B=100)
:Then
:Return
:END
:GOTO 1
Hope that example helps. Sometimes you may need to ask me a question if you really dont get it... Email jjdb210@hotmail.com.
The Next command is the MENU command. This is used to make those fancy menus that you see threwout the calculator. Here's how it works. Menu("TITLE","OPTION 1",1,"OPTION 2",2). The Title is what appears on the top of the screen. Option 1 is the first choice and Option 2 is the second choice. The 1 and the 2 tell the program where to go if its selected. So the 1 GOTOs LBL 1, and the 2 GOTOs LBL 2. Its again something that is sometime really confusing but here is an example...
Program Hi
:Menu("This is Hi","Hi",A,"Hello",2)
:lbl A
:Disp "Hi"
:STOP
:lbl 2
:Disp "Hello"
:STOP
That should help you some to understand the menus. Another way to learn about them is to read the programming section of your TI-82 instruction book!