Microsoft KB Archive/81467

= Microsoft Knowledge Base =

Test for Windows: Line Input Replaces CTRL+Z (EOF) with Space
Last reviewed: October 19, 1994

Article ID: Q81467

The information in this article applies to:

- Microsoft Test for Windows, versions 1.0 and 2.0

SUMMARY
When using Microsoft Test's Line Input statement to input text from a file, all CTRL+Z characters will be read in and converted to one space each rather than interpreted as an end of file (EOF) marker.

MORE INFORMATION
To demonstrate this feature, do the following:

 Create a text file (TEST.TXT) with a CTRL+Z in the first line and text following the CTRL+Z. You can do this in Basic by opening a file for binary and sending some text to it followed by a chr$(26) (character code for CTRL+Z) character, followed by more text.  Start the MSTest driver and add the following code to Script1: Open &quot;Test.TXT&quot; for input as #1 Line Input #1, Text$ Print Text$ 

The result is that CTRL+Z was not treated as an EOF marker, because it has been replaced by a space and the following text was read in. This behavior is by design. To check for embedded CTRL+Z characters, you have to programatically check every character that is read.