/* * input tests - input, inputKey, inputEvent, inputDialog */ #include "t3.h" #include "tads.h" _say_embed(str) { tadsSay(str); } class RuntimeError: object construct(errno, ...) { errno_ = errno; } display = "Runtime Error: <>" errno_ = 0 ; _main(args) { try { t3SetSay(_say_embed); main(); } catch (RuntimeError rte) { "\n<>\n"; } } function main() { local x; "Input and input key tests.\n"; "Enter a command: "; x = inputLine(); "You entered: \"<>\"\n"; "Press a key..."; x = inputKey(); "You typed: \"<>\"\n"; "Enter an event..."; x = inputEvent(); "Event code = <>, additional data = \"<< x.length() > 1 ? x[2] : "">>\"\n"; "Dialog...\n"; x = inputDialog(InDlgIconNone, 'This is a sample dialog prompt!', ['Hello', 'Goodbye', 'Anyway'], 1, 2); "Response = <>\n"; x = inputDialog(InDlgIconQuestion, 'A standard yes/no dialog!', InDlgYesNo, 1, 2); "Response = <>\n"; x = inputDialog(InDlgIconInfo, 'Another dialog!', [InDlgLblOk, InDlgLblNo], nil, nil); "Response = <>\n"; "Done!!!\n"; }