/doc/efun/input_to


SYNOPSIS

void input_to(string fun)
void input_to(string fun, int flag, ...)

DESCRIPTION

Enable next line of user input to be sent to the local function fun as an argument. The input line will not be parsed, only when it starts with a "!" (like a kind of shell escape) (this feature may be disabled).

Note that fun is not called immediately but after pressing the RETURN key.

If input_to() is called more than once in the same execution, only the first call has any effect.

The optional argument <flag> may be a binary-OR ('|') of the following option values

The optional 3rd and following args will be passed as second and subsequent args to the function fun. (This feature is was added only recently, to avoid the need for global variables)

EXAMPLE

	void func() {
	   ...
	   write("Please enter your name:");
	   input_to("enter_name");
	   ...
	}
	enter_name(string str) {
	   write("Is '"+str+"' really your name?? *giggle*\n");
	   ...
	}
When reaching the input_to() statement the driver continues the function func() but also asks the user for input. If you entered whatever is asked and press RETURN the driver will invoke the enter_name() function with the string you entered as argument to it.

HISTORY

The meaning of the flag parameter was extended in 3.2.1@93.

SEE ALSO

call_other
sscanf
privilege_violation

| Home | Applied | Concepts | Efuns | Help | Intro | Lib | LPC | Prop | Obj | Sefuns | Std | W |

Nightfall@quest.tat.physik.uni-tuebingen.de
Automatically generated on Don, 11. Apr 1996