Query(Caption:string;[Timeout:number;Default:boolean]);

Running this RS/2 script:

// REDTITAN RS2 CONTROL

repeat

if query('Please click YES or NO') then writeln('RESPONDED YES') else writeln('RESPONDED NO');
flash('User interaction'#10'demo');
writeln(query('JUST LET THIS TIMEOUT (1)',3000,TRUE));
writeln(query('JUST LET THIS TIMEOUT (2)',3000,FALSE));

until not query('Carry on?');

 

displays a dialog containing YES button and a NO button under the Caption Please click YES or NO:

Click to expand/collapse image

If you click YES, writeln procedure writes RESPONDED YES in the EscapeE log but if you click NO, RESPONDED NO is written instead.
Another dialog then appears with the caption JUST LET THIS TIMEOUT to demonstrate Timeout in use.
If you click YES, TRUE is logged, if you click NO, FALSE is logged. If you do not click the YES or NO buttons then after 3 seconds, Query function times-out and TRUE is written to the log.
Another timeout dialog appears to demonstrate the Default value FALSE being logged.
The last dialog appears with Carry on? as the Caption
Click YES to run through the example again or NO to finish.