READ

The READ command transfers input from the current device to a global or local variable specified as a READ argument. For convenience, READ also accepts arguments that perform limited output to the current device.

The format of the READ command is:

	R[EAD][:tvexpr] glvn|*glvn|glvn#intexpr|strlit|fcc[,...]
	

The maximum length of the input string is the smaller of the device buffer size limitation or the GT.M maximum string length (32,767 characters). If a record is longer than the maximum record length, GT.M returns the record piece by piece during sequential reads, for devices that allow it.

When a string literal appears as an argument to a READ, M writes the literal to the current device. String literals appear as READ arguments to serve as prompts for input. GT.M does not permit expression arguments on a READ to act as prompts. Variable prompts must appear as arguments to a WRITE. If a variable appears as an argument to a READ, GT.M always interprets it as input, never as output. This facility is used mostly with terminal I/O.

The READ commands adjust $X and $Y, based on the length of the input read.