![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
TI BASIC help
I'm sorry for putting this in this forum, but it's as close to a TI forum as I can find. Is there a way give the calculator instructions in case of the variable being null?
Thanks to anyone who can help, David |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
Yea, are you talking about like A-Z number vars, lists, strings, matrixes, pics, or gdb's?
I know everything about TI-Basic, lol.
__________________
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
I'm using an 89, and so say i want someone to make a choice in a dropdown menu, and if they hit cancel, keep the program from saying undefinded variable error and just give it instructions on what to do, such as ending the program
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
I've only written on TI-83+, if you could show me some code i might be able to help you out. On TI-83+ there is something called the menu() function which creates a menu with a title, and options and references to label name's that it's sent to...
TI-Basic(83+) Menu Example: ClrHome
Lbl M
Menu(" Test program ", "Goto A", A, "Exit", E)
Lbl A
ClrHome
Disp "This is a test"
Pause
Goto M
Lbl E
ClrHome
Output(1,1," ")
__________________
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
OK
Dialog
Title "The Ultimate Pre-Cal Program"
DropDown "Calculate:",{"Area of „","Comp Angles","Degree»Radian","Grade","Find Quadrant","sin, cos, etc.","Distance"},feat
EndDlog
Determining feature
If feat=0 Then
Goto quit
ElseIf feat=1 Then
Goto „a
ElseIf feat=2 Then
Goto comang
ElseIf feat=3 Then
Goto dtr
ElseIf feat=4 Then
Goto grade
ElseIf feat=5 Then
Goto quad
ElseIf feat=6 Then
Goto sct
ElseIf feat=7 Then
Goto dist
EndIfbut if you hit the ESC button, it doesnt give a number to the variable, and it continues on to the Ifs, and it is still undefined so it crashes, I have on other programs, set feat to 0 after the goto so it will have the If feat=0 Then Goto Quit EndIf |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Mar 2005
Posts: 1
Rep Power: 0
![]() |
hmmm, I also just program on the TI-83 Plus but...I'll try not to be technical
ok, so you want to retain the previous selection...here we go then Try this (in psuedocode since i havent programmer 89's): ( -> denotes that value is being stored to variable aka 1->A places the value 1 into A) [beginCode] ...The first line of your programs initialize (declare your variables set to 0)... ...begining of program... 0->prevchoice 0->choice ...somewhere else in the program... choice->prevchoice 0->choice Dialog Title "The Ultimate Pre-Calculus Program" DropDown "Calculate:",{"Area of „","Comp Angles","Degree»Radian","Grade","Find Quadrant","sin, cos, etc.","Distance"},choice EndDlog ...i modified this part... if choice=0 Then prevchoice->choice goto quit ElseIf feat=1 Then Goto a ElseIf feat=2 Then Goto comang ElseIf feat=3 Then Goto dtr ElseIf feat=4 Then Goto grade ElseIf feat=5 Then Goto quad ElseIf feat=6 Then Goto sct ElseIf feat=7 Then Goto dist EndIf [endCode] I dont know if that will work, but just maybe..... get back with me on the results ![]() Last edited by lunardragoon; Mar 30th, 2005 at 5:53 PM. Reason: Didnt see the end of the post with the code :) |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
Actually, I was just thinkin about doing that just the other day. The Chances of that working is 95%, so thank you a bunch. I am really suprised that there aren't that many 89 programmers out there. Take it easy
--David |
|
|
|
|
|
#8 |
|
Expert Programmer
|
Does this language not have a select statement?
|
|
|
|
|
|
#9 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
Rory, it doesn't have shit. I'm not really sure I would call it a programming language...
|
|
|
|
|
|
#10 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
i wouldn't really call it a language either. You can run the program just by typing it into the home screen. I've actually confused myself, because it seems like a language, and it technically might be a language....idk.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|