Why ON KEY GOSUB doesn´t work?

Por MäSäXi

Paragon (1884)

Imagen del MäSäXi

07-11-2010, 23:49

It is quite obvious what this little program should do.

1 ONKEYGOSUB10:KEY(2)ON
5 COLOR ,6:COLOR ,10:GOTO 5
10 PRINT"why program just slows down and prints nothing? :-(":RETURN

I understand that it slows down because of that interrupt, but I can´t understand why it doesn´t print anything? Question

With KEY(1)ON it works like it should, but with 2,3,4 and 5 it doesn´t.

Why?

I used MSX - swedish on blueMSX.

Login sesión o register para postear comentarios

Por flyguille

Prophet (3031)

Imagen del flyguille

07-11-2010, 23:56

because you are defining that LINE 10 goes for KEY(1) , and you are enabling Key(2)

ON KEY GOSUB <line for key1> ,<line for key2> ,<line for key3> ,<line for key4> ,<line for key5> , ....

Por MäSäXi

Paragon (1884)

Imagen del MäSäXi

08-11-2010, 08:21

Of course... I forget about that... thank you! Smile

It feels silly though, that one needs to define line numbers for F1,F2,F3 and F4 if one wants to just use F5. And nine line numbers, if F10 is the only one needed.

<edit> Please forget that last one... Just understood that ON KEY GOSUB,10 does the job. Smile