Author Topic: Detecting/controlling homescreen clears?  (Read 4365 times)

0 Members and 1 Guest are viewing this topic.

Offline soren121

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Detecting/controlling homescreen clears?
« 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!
« Last Edit: September 10, 2011, 05:49:39 pm by soren121 »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Detecting/controlling homescreen clears?
« Reply #1 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.
« Last Edit: September 10, 2011, 06:07:43 pm by yeongJIN_COOL »
Sig wipe!

Offline soren121

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: Detecting/controlling homescreen clears?
« Reply #2 on: September 10, 2011, 06:11:25 pm »
...such a simple solution. :o

I'd still like to know if it's possible, though.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Detecting/controlling homescreen clears?
« Reply #3 on: September 10, 2011, 06:14:06 pm »
I do not believe it is possible without some assembly unfortunately :(

Offline soren121

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: Detecting/controlling homescreen clears?
« Reply #4 on: September 10, 2011, 06:14:48 pm »
Ah, that sucks. Thanks!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Detecting/controlling homescreen clears?
« Reply #5 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...
« Last Edit: September 10, 2011, 06:17:27 pm by yeongJIN_COOL »
Sig wipe!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Detecting/controlling homescreen clears?
« Reply #6 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.
« Last Edit: September 11, 2011, 12:46:50 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)