TIB: Re: Basic '86 -Why doesn't this Work?


[Prev][Next][Index][Thread]

TIB: Re: Basic '86 -Why doesn't this Work?




Okay you made a very simple mistake.
Put the getkey command inside lbl abc
new code should be:
ClLCD
:ClDrw
:yMin(storeto)YM
:yMax(storeto)YX
:-6(storeto)Min
:6(storeto)Max
:DispG
:Line(-5,-5,-5,5)
:Line(-5,5,5,5)
:Line(5,5,5,-5)
:Line(5,-5,-5,-5)
:Text(30,45,"@")
:DispG
:
:Lbl ABC
:getKy(storeto)A:
If A==22
:Then
:Goto OFF
:Else
:Goto ABC
:Lbl OFF
:ClDrw
:YM(storeto)Min
:YX(storeto)Max
:Stop
The reason is that getkey would only be called once.  This gives you no time
to press exit.  If it is inside the loop then you have all the time in the
world.  If you are new to basic check out my page.
************************************
dave
ICQ:16817590
E-mail: scheltem@aaps.k12.mi.us
TI86 Basic Programming Center
http://www.geocities.com/TimesSquare/Ring/8708/

-----Original Message-----
From: Nick Clark <roachnik@home.com>
To: ti-basic@lists.ticalc.org <ti-basic@lists.ticalc.org>
Date: Sunday, August 30, 1998 6:32 PM
Subject: TIB: Basic '86 -Why doesn't this Work?


>
>Why doesn't this work? This picture draws OK, and places the @ symbol,
>and I think it waits for the getky, but when I hit exit(key 22) it
>doesn't quit. What am I doing wrong?
>
>
>By (storeto), I mean the store variable arrow.
>
>:ClLCD
>:ClDrw
>:yMin(storeto)YM
>:yMax(storeto)YX
>:-6(storeto)Min
>:6(storeto)Max
>:DispG
>:Line(-5,-5,-5,5)
>:Line(-5,5,5,5)
>:Line(5,5,5,-5)
>:Line(5,-5,-5,-5)
>:Text(30,45,"@")
>:DispG
>:getKy(storeto)A
>:Lbl ABC
>:If A==22
>:Then
>:Goto OFF
>:Else
>:Goto ABC
>:Lbl OFF
>:ClDrw
>:YM(storeto)Min
>:YX(storeto)Max
>:Stop
>