getch ...

Prev Next

Function Names

getch, getch ignore case

Description

These two functions read one single character without need to push [Enter] and without the charactered echoed on the screen which is the case in the functions input quick() and input quick ignore case().

Call as: function

Restrictions

Indirect parameter passing is disabled.

Parameter count

0 or 1

Parameters

No.TypeDescription
Opt. 1
input
string Allowed characters

Put all allowed characters into the string. Execution will only continue if the check is OK.

Return value

TypeDescription
string Entered character

Examples

    do
    {
        echo("Enter a character between 'a' and 'e'. 'x' = exit");
        ch[] = getch ignore case( abcdex );
        echo("Character entered: ", ch[] );
    } while (ch[] <> X);
    echo("Done.");

Output

Try it yourself: Open LIB_Function_getch.b4p in B4P_Examples.zip. Decompress before use.

See also

input quick
input quick ignore case