FIX: "Syntax Error" in .SPR File with #SECTION Directive

Last reviewed: September 22, 1997
Article ID: Q99610
2.50    | 2.50
WINDOWS | MS-DOS kbprg kbfixlist kbbuglist kberrmsg

The information in this article applies to:

  • Microsoft FoxPro for MS-DOS, version 2.5
  • Microsoft FoxPro for Windows, version 2.5

SYMPTOMS

When you are using the #SECTION directive in the setup code of a screen, the resulting .SPR file will produce a "Syntax Error" message. The error occurs only if a semicolon (;) is used to divide a line of code under the #SECTION 2 directive.

RESOLUTION

To work around this problem, use one semicolon in the #SECTION 2 code. If the code requires more than one semicolon, you must use a new command. For example, the following change will correct the faulty code shown in the "More Information" section below:

   #SECTION 2
   PRIVATE ;
   var1, var2
   PRIVATE ;
   var3

MORE INFORMATION

If the following code is used in the setup code of a screen in the Screen Builder, an error will occur when you try to run the .SPR program:

   #SECTION 1
   PARAMETER ;
   var1, ;
   var2

   #SECTION 2
   PRIVATE ;
   var3, ;
   var4

When this code is generated, the SECTION 2 code is placed in the SECTION 2 generated code area. In addition, the first two lines of this code are placed at the end of the SECTION 1 generated code. This is where the error occurs. Below is an example of the generated code:

   #region 1
   private ;
   var3, ;

This code will cause an error because the semicolon at the end of the third line makes FoxPro assume that the next line is part of the third line of code.


Additional reference words: FoxWin FoxDos 2.50 errmsg err msg buglist2.50
fixlist2.50a
KBCategory: kbprg kbfixlist kbbuglist kberrmsg
KBSubcategory: FxtoolSbuilder
Keywords : FxtoolSbuilder kbbuglist kberrmsg kbfixlist kbprg
Version : 2.50 | 2.50
Platform : MS-DOS WINDOWS
Solution Type : kbfix


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: September 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.