std-yesno and variants


Synopsis

(std-yesno <msg> <def>) ;

(std-inp-yesno <msg> <def>) ;

(std-dcl-yesno <msg> <def>) ;

(std-yes-or-no-p <msg> <def>) ;

Description

These functions are used to ask for a confirmation. All return either T or nil.

The four versions differ only in the way how to ask or how severe it is.

STD-INP-YESNO uses the console for in and output.

STD-DCL-YESNO uses a dialog with the formatted message and two buttons (Ok and Cancel) for in and output.

STD-YESNO decides between using either no user-input (in scripts), std-inp-yesno or std-dcl-yesno if another DCL is active.

STD-YES-OR-NO-P is the severe version. You'll have to enter the full name of "Yes" or "No", the value different from the default value, to confirm it. No abbrevation is allowed.

Locale translations?

(std-yes-no-or-p "Do you really want to exit?" "No")

(std-yes-no-or-p "Do you really want to delete \"ACAD.LSP\"?" "No")

to be continued..

Arguments

msg: a string to be displayed as a prompt or nil.

def: a default value. Either T or nil or any string. If the string is equal to "No", "N", "_N" or "_No" a false default is assumed, otherwise true.

Return Value

Either T or nil

Side Effects

Interrupts the program flow, presents a formatted message and waits for user input.

Module

(std-require 'STDINPUT)

Defined in STDINPUT