Page 1 of 1
How to listen for input while paused?
Posted: Tue Sep 19, 2023 9:23 pm
by okto
I want to have a message display for either a set amount of time using PAUSE or to be dismissed by key input before the PAUSE time has elapsed.
How do I do this?
How to listen for input while paused?
Posted: Wed Sep 20, 2023 6:00 am
by Martin
Hi Okto
PAUSE
Syntax: PAUSE x%
Pauses the program according to the value of x%:
0 Waits for a key to be pressed.
<0 Pauses for x% (made positive) twentieths of a second or until a key is pressed.
>0 Pauses for x% twentieths of a second.
So PAUSE 100 would cause the program to pause for five seconds. In the first two cases, the key pressed is stored in a buffer and it is wise to remove it with the KEY function:
Code: Select all
<statement list>
PAUSE 0
KEY
<statement list>
The keypress stored in the buffer from the PAUSE 0 command is taken as the input for KEY.
Also (but not in the manual) if you want to 'use' the keypress then put in in a variable for example i%=KEY
In good faith Martin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reference page 82 of the republished Organiser Programming Manual
(here)
Re: How to listen for input while paused?
Posted: Wed Sep 20, 2023 2:44 pm
by okto
Perfect, thank you!