Command: ifyes

Syntax

ifyes <message>
    <command_block>

Description

Prompt the operator for a yes/no answer via a dynamic menu.

Parameters

Switches

Notes

A question mark ( ? ) will be automatically added to the prompt.

The command or command block on the line following the ifyes command will be executed if a Yes answer was given by the operator. This may be followed by an else statement which will be executed if a No answer was given.

When used in conjunction with master menus (-m), the selection of a master menu command resulting in an abort of the pop-up will skip execution of the <command_block> associated with this command and any accompanying else statement.

Examples

Single command execution on answering Yes. Note the semicolon to indicate a new line.

ifyes 'OK so far'; return

Command block execution.

ifyes 'Do you wish to exit', -n {
    exec tidyup
    return
}
else !Continuing

See Also

Commands:

if, ifno, else, interrupt, poll, return, unless