This shows you the differences between two versions of the page.
— |
input_char [2006/08/01 03:45] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Synopsis:====== | ||
+ | __input_char__ [-noecho] "<prompt>" {<stuff>} | ||
+ | |||
+ | ======Description:====== | ||
+ | This command prompts the user to type ONE character and then runs the | ||
+ | <stuff> and $* will be the user's response. | ||
+ | |||
+ | The -noecho option will suppress the outputting of the character to the | ||
+ | input line as it is typed. | ||
+ | |||
+ | The $'...' expando is a wrapper around __INPUT_CHAR__ in case you were | ||
+ | wondering. It's always better to use __INPUT_CHAR__ than $'...' if you | ||
+ | can arrange it because it operates asynchronously, which means it plays | ||
+ | nicely with other commands. | ||
+ | |||
+ | ======Examples:====== | ||
+ | input_char "Press 'q' to quit, any other key to continue: " { | ||
+ | unless ( [$0] == [q] ) { | ||
+ | /* do whatever */ | ||
+ | } | ||
+ | } | ||
+ | |||
+ | ======History:====== | ||
+ | The __INPUT_CHAR__ command first appeared in EPIC3.003. | ||