BUG: Hang or GPF in Browse with S<n> Function Code

Last reviewed: June 27, 1995
Article ID: Q108634
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b

SYMPTOMS

If the following conditions are present when you are browsing a database, FoxPro for MS-DOS locks up or exits to the MS-DOS prompt and FoxPro for Windows causes a general protection (GP) fault:

  • A character field in the database is 254 characters wide. This is the maximum width allowed for a character field. Widths less than this should not cause the problem.
  • The BROWSE FIELDS command is issued and the character field with the width of 254 has the S<n> function code applied to it. The S<n> function code limits the display width to the number of characters specified in place of <n>.

RESOLUTION

As an alternative to the S<n> function code, use the :<column width> clause. For example:

   BROWSE FIELDS cno, company :20, contact

STATUS

Microsoft has confirmed this to be a problem in FoxPro versions 2.5, 2.5a, 2.5b, and 2.6 for MS-DOS and FoxPro versions 2.5, 2.5a, and 2.5b for Windows. This problem does not occur in FoxPro version 2.6 for Windows. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Modify the structure of the CUSTOMER database so that the COMPANY field is 254 characters wide. The CUSTOMER database can be found in the TUTORIAL subdirectory of the directory where FoxPro is installed.

  2. Make sure the CUSTOMER database is in use.

  3. Issue the following command in the Command window:

          BROWSE FIELDS cno, company :P='@S20', contact
    

    This command will browse the CNO, COMPANY and CONTACT fields in the CUSTOMER database. The COMPANY field should display only 20 characters.

If you are running the Standard (16-bit) version of FoxPro for MS-DOS (FOXPRO.EXE), tabbing to the COMPANY field from one of the other fields places the information from that field in the COMPANY field. Scrolling the COMPANY field using the arrow keys causes the information from the previous record to appear in the current record. This behavior is just temporary; it does not permanently change the database. Eventually FoxPro locks up.

If you are running the Extended (32-bit) version of FoxPro for MS-DOS (FOXPROX.EXE), tabbing to the COMPANY field either locks up FoxPro or causes FoxPro to exit to MS-DOS. You may also receive the "Abnormal Program Termination: Memory Protection Fault" error message.

If you are running FoxPro for Windows, FoxPro causes a GP fault before the Browse window can be completely displayed.

REFERENCES

"Language Reference," version 2.5, pages L3-33 through L3-35 and L3-235 through L3-238


Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b buglist2.50
buglist2.50a
buglist2.50b crash exit quit bnormal GPF UAE 2.60 buglist2.60
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgBrowse


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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.