Microsoft KB Archive/41039

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

ENTER Key Gives Linefeed in XENIX, Carriage Return in MS-DOS

PSS ID Number: Q41039 Article last modified on 04-20-1993

2.00 2.10 2.20 | 2.10 2.20 MS-DOS | XENIX

The information in this article applies to:
- Microsoft COBOL for MS-DOS, versions 2.0, 2.1, and 2.2 - Microsoft COBOL for XENIX, versions 2.1 and 2.2

Summary: Under the XENIX operating system, pressing the ENTER key returns a newline character (linefeed, LF, ASCII value of decimal 10), which tells the program to terminate input on a line. In contrast, under the MS-DOS operating system, pressing the ENTER key returns a carriage return (CR, Decimal 13) as the termination character. This difference between operating systems is invisible to COBOL programs. The ENTER key terminates ACCEPT statements in COBOL programs for both XENIX and MS-DOS. This difference between operating systems is noticeable in BASIC when using the INKEY$ function to return the value of the ENTER key. (For more information, query on the keywords CARRIAGE RETURN and XENIX BASIC).

Additional reference words: 2.00 2.10 2.20 Copyright Microsoft Corporation 1993.