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?
- Martin
- Global Admin
- Posts: 227
- Joined: Mon Jan 02, 2023 5:18 pm
How to listen for input while paused?
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:
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)
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>
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)
-
- Posts: 59
- Joined: Sun Apr 23, 2023 5:14 am
Re: How to listen for input while paused?
Perfect, thank you!