Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
Hi, I am learning TI basic right now. I cannot get my ELSE statement to work on my calculator after an hour of trying to change things. I am trying to make my calculator have an conversation with me. Here is my code:

ClrHome
Input "What is your name? ",Str1
Disp Str1+" is an cool name!"
Disp "My name is TI-84 Plus CE!"
Input "How old are you? ",A
If A<10
Then
Disp "Wow you are so young!"
End
Else
Disp "You are older than 9 so you are cool."
End
Pause
Can someone help me?
 
I don't know TI Basic but it looks to me like the first of the two End statements ends your code segment, regardless of which way the "if" turns out. The compiler (or interpreter, whatever the case) perhaps does not even see the code under that.
 
Hi, I am learning TI basic right now. I cannot get my ELSE statement to work on my calculator after an hour of trying to change things. I am trying to make my calculator have an conversation with me. Here is my code:

ClrHome
Input "What is your name? ",Str1
Disp Str1+" is an cool name!"
Disp "My name is TI-84 Plus CE!"
Input "How old are you? ",A
If A<10
Then
Disp "Wow you are so young!"
End
Else
Disp "You are older than 9 so you are cool."
End
Pause
Can someone help me?
WHOOPS I just realized that there were RULES for the code :|
Code:
ClrHome
Input "What is your name? ",Str1
Disp Str1+" is an cool name!"
Disp "My name is TI-84 Plus CE!"
Input "How old are you? ",A
If A<10
Then
Disp "Wow you are so young!"
End
Else

Disp "You are older than 9 so you are cool."
End
Pause
 
I don't see any difference in the new code, except a newline after Else. Don't tell me that made it work ? It wouldn't be the right solution. The End statement is to mark the end of an if..then statement, not sit in the middle of it. As explained here https://tibasic.fandom.com/wiki/End

I now remember having programmed TI basic but it must have been around 45+ years ago. I had one of these fancy TI programmables with a thermal printer you could dock it into, and magnetic memory cards which would fail half the time. It did not take long to come to the conclusion I had wasted precious money. Good old days 🙄
 
I don't see any difference in the new code, except a newline after Else. Don't tell me that made it work ? It wouldn't be the right solution. The End statement is to mark the end of an if..then statement, not sit in the middle of it. As explained here https://tibasic.fandom.com/wiki/End

I now remember having programmed TI basic but it must have been around 45+ years ago. I had one of these fancy TI programmables with a thermal printer you could dock it into, and magnetic memory cards which would fail half the time. It did not take long to come to the conclusion I had wasted precious money. Good old days 🙄
Thanks, after going to that website and changing things I can finally move on with my conversation program.
 

New Threads

Buy us a coffee!

Back
Top Bottom