Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: soren121 on September 10, 2011, 05:45:45 pm
-
So, I've written a joke program that imitates the homescreen, but outputs Fish for 2+2. This is it:
2→A
ClrHome
While 1
Input "",Str1
If Str1="2+2"
Then
Output(A,13,"FISH")
Disp ""
Else
Disp expr(Str1
End
If A<8
Then
A+2→A
End
End
It works perfectly, except for one critical bug: if you press CLEAR, the line counter for the word FISH isn't updated, and it will display it in the wrong place.
So my question is, is there a way to detect if the homescreen is cleared, or if I can control that? Or is there a better way to display FISH than Output()?
Thanks!
-
instead Output(A,13,"FISH"),
you could do Disp " FISH", since text tends to display at left side if I remember.
Then you wouldn't need that line counter anymore.
-
...such a simple solution. :o
I'd still like to know if it's possible, though.
-
I do not believe it is possible without some assembly unfortunately :(
-
Ah, that sucks. Thanks!
-
I don't think you can because of that Input method. getKey can handle keypresses, but you can't use getKey and Input at the same time so...
-
Not sure if it would help but you could put a getKey in there and check if it is ever equal to forty-five (the key press for the [CLEAR] button) and do stuff then. But other than that I don't think so without Assembly, like Builder said.
Edit:
Nevermind, just understood what was happening. Ya, Assembly I think is your best option. You could ask Xeda to help you write a hex routine for it.