TIB: Re: TI-Basic Digest V1 #468


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

TIB: Re: TI-Basic Digest V1 #468




maybe just switch my program to store both variables into real number values
and then compare those?

jimi

<<<<<<<<<<<<<<<<<<<<
I tried this on my 86 and it doesn't work.

This is because once a key is pressed, the calc's getky will store the
keypress to the Ans var.  Then when another getky is called, it doesn't
recognize a key that's held down, so the key's status is reset to off, as if
no key is being pressed at all.

~Dave <the_regul8r@bigfoot.com>

- -----Original Message-----
From: Jimi Malcolm <MalcolmJ1@email.msn.com>
To: ti-basic@towerguard.unix.edu.sollentuna.se
<ti-basic@towerguard.unix.edu.sollentuna.se>
Date: Thursday, March 18, 1999 10:58 PM
Subject: TIB: Re: TI-Basic Digest V1 #467


>
>here's a quick example of how you would have a program tell how long the
key
>was held down for.  i wrote it for my ti85 because i don't have an 83.  i
>hope you can somehow get the idea and port it to your 83.
>
>first it waits for any key to be held which is the first 'while-loop'.
>next, it stores that value as something different and waits until that
value
>is not the same as what is being read anymore.  every loop it checks what's
>currently being pressed to what was pressed, it increments 'B'.  once the
>key is depressed, the second 'while-loop' is ended and the value of 'B' is
>displayed added with 3 to compensate for the first loop's run time.  3 is
>not an accurate number for the first 'while-loop's run time.  i hope this
>helps.
>
>jimi
>=========================================
>PROGRAM=KeyTime
>:Disp "Hold key down now..."
>:0(stored)B
>:While A==0
>:getKy(stored)A
>:End
>:While Ans==A
>:getKy
>:B+1(stored)B
>:End
>:Disp "You held that key","down for:",B+3,"seconds."
>=========================================
>
><<Using a TI-83 is there any way to find out how long a user has held down
>a key? It would be simple if it weren't for the fact that a variable
>gotten by something like this:
>getKey->A
>is constantly being reset to zero when a key is not being pressed.
>How, if there is indeed a way, can it be done?>>
>
>
>>>>>>>>>>>>>>>>>>>>>>>
>
>