From Wikibooks, open books for an open world
CONFIRM question /with choices
Confirms a user choice.
CONFIRM is a function value.
- question -- Prompt to user (Type: series)
- choices -- (Type: string block)
confirm: func [ "Confirms a user choice." question [series!] "Prompt to user" /with choices [string! block!] /local yes no ][ question: form question if with [ yes: "Yes" no: "No" if string? choices [yes: choices] if all [block? choices not empty? choices] [ either tail? next choices [yes: choices/1] [set [yes no] choices] ] question: reduce [question yes no] ] request/confirm question ]