Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: soren121 on September 10, 2011, 05:45:45 pm

Title: Detecting/controlling homescreen clears?
Post 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:

Code: [Select]
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!
Title: Re: Detecting/controlling homescreen clears?
Post by: Yeong on September 10, 2011, 06:07:10 pm
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.
Title: Re: Detecting/controlling homescreen clears?
Post by: soren121 on September 10, 2011, 06:11:25 pm
...such a simple solution. :o

I'd still like to know if it's possible, though.
Title: Re: Detecting/controlling homescreen clears?
Post by: Builderboy on September 10, 2011, 06:14:06 pm
I do not believe it is possible without some assembly unfortunately :(
Title: Re: Detecting/controlling homescreen clears?
Post by: soren121 on September 10, 2011, 06:14:48 pm
Ah, that sucks. Thanks!
Title: Re: Detecting/controlling homescreen clears?
Post by: Yeong on September 10, 2011, 06:16:57 pm
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...
Title: Re: Detecting/controlling homescreen clears?
Post by: meishe91 on September 11, 2011, 12:43:30 pm
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.