Rebol 程式設計/確認
外觀
CONFIRM question /with choices
確認使用者選擇。
CONFIRM 是一個函式值。
- 問題 -- 提示使用者(型別:系列)
- /with
- 選項 --(型別:字串塊)
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
]