READ to Unit 1

Product Version(s): 3.20
Operating System:   MS-DOS
Flags: enduser |
Last Modified:  2-MAY-1988    ArticleIdent: Q10661

Problem:
   A program opens the console as logical unit 1 in the main program.
A subsequent "READ(1," in a subroutine fails to read any data from the
keyboard. When the "READ (1," is replaced by a "READ (0," the program
works properly.

Response:
   The READ statement to unit 1 is correctly taking the error path
because you cannot read from a unit to which you have just written
without first doing a Rewind and BACKSPACE. You cannot rewind the
console.
   One method to achieve your goal is to READ and WRITE from different
units both connected to CON.
