--============================================================================= --| --| TASK NAME: numbers.search.monitor_keyboard --| --| ALGORITHM/STRATEGY: The task waits for a call to entry --| begin_keyboard_monitor. It then enters a loop to alternately read a --| line from the keyboard and call synchronize.keyboard_interrupt. --| --| NOTES: None. --| --============================================================================= WITH text_io; SEPARATE (numbers.search) TASK BODY monitor_keyboard IS -- Position of last character on input line last : natural; --Input line entered by user response : string(1 .. line_length); BEGIN -- monitor_keyboard -- Wait for signal to begin monitoring for user input ACCEPT begin_keyboard_monitor; -- Process signals from user LOOP -- Read input text_io.get_line (item => response, last => last); -- Signal interrupt synchronize.keyboard_interrupt; END LOOP; END monitor_keyboard;