BUG: FoxPro for Unix Reports an Error for the Wrong Line

Last reviewed: January 16, 1996
Article ID: Q142316
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: kbenv kbbuglist
KBSubcategory: FxenvGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.