Microsoft KB Archive/142316

{| = BUG: FoxPro for Unix Reports an Error for the Wrong Line =
 * width="100%"|

ID: Q142316

2.60 UNIX

kbbuglist The information in this article applies to:
 * Microsoft FoxPro for UNIX, version 2.6

SYMPTOMS
While you run a .prg file, an error is reported but a line that did not cause the error is highlighted.

CAUSE
This behavior occurs only under very specific, but difficult to predict circumstances. The .prg file is divided into 512 byte blocks. This causes the line numbering to be thrown off by one every time the last byte in a block is the carriage return character: CHR(13).

WORKAROUND
Use one of the following methods to correct the problem:

 Insert a character into or delete a character from the line preceeding the line that was highlighted when the error was displayed. It can be any character or comment, as long as it does not affect the function of the code. -or-  Use the following code to locate the line that contains the offending CHR(13): CHECKIT.PRG --- parameter fname set talk off clear fh=fopen(fname) do while not feof(fh) data=fread(fh,512) if LEN(data)=512 boundry=asc(right(data,1)) if boundry=13 @12,10 say right(data,60) ??CHR(7) =inkey(0) ENDIF ENDIF enddo =fclose(fh) Call the code for each program that causes the problem, as follows: DO CHECKIT.PRG WITH "TEST.PRG" Once the line with the offending chr(13) is located, do one of the following: - Insert an extra character into the line. -or- - Delete a character from the line. 

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION
While you run a FoxPro program, if a line of code causes an error, that line is highlighted when the error message is displayed.

In some cases, however, the line preceeding the line that caused the error is highlighted. For example, a "?" command on line #2 produces an "Unrecognized command verb" error. When the error message is displayed, Line #1 will be highlighted instead of Line #2. You may also notice that when running Debug, FoxPro does not run the highlighted line. This type of error may come and go as lines in the effected .prg file are edited.

Additional reference words: 2.60 FoxUnix buglist2.60 KBCategory: kbbuglist KBSubcategory: FxenvGeneral

Keywords         : kbenv FxenvGeneral kbbuglist Version          : 2.60 Platform         : UNIX
 * }