Microsoft KB Archive/221646

= FIX: ERR Files Contain Carriage Return and No Linefeed =

Article ID: 221646

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q221646



SYMPTOMS
You compile a Visual FoxPro program file, form, class library, or report that contains at least one compile error. SET LOGERRORS is ON, which is the default, and this forces Visual FoxPro to write any compile errors to a .ERR file. When the .ERR file is opened within the Visual FoxPro editor, it will appear as expected with line feeds between each line, but if the file is opened with another editor, such as Notepad, no line feeds appear, and the text will all appear on a single line.



CAUSE
The .ERR file is written with a carriage return character (ASCII value 13) at the end of each line, but no line feed character (ASCII 10). The Visual FoxPro editor moves to a new line with each ASCII 13 character, but other editors such as Notepad may not.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed



Steps to Reproduce Behavior
  Run the following code from a program (.PRG) file: =STRTOFILE('This line will cause an error!'+ CHR(13) + CHR(10) + ; 'So will this one!', 'testxx.prg') SET LOGERRORS ON   && This is the default COMPILE testxx.prg RUN /N notepad testxx.err MOTE: If you are running Visual FoxPro 3.0 or 5.0, then you must create the program file manually. The STRTOFILE function is not available in earlier versions of Visual FoxPro.

 Look at the error file that is opened in Notepad. All the text will appear on the same line, but it will wrap if Word Wrap is enabled in Notepad. The file will contain the text below. The character represented here as [] will appear as a black square in Notepad.

This line will cause an error![]Error in line 1: Unrecognized command verb.[]So will this one![]Error in line 3: Unrecognized command verb.[]

