FIX: PARAMETER in #SECTION Directive Not in Generated Code

ID: Q98435

2.50    | 2.50
WINDOWS | MS-DOS kbprg kbfixlist kbbuglist

The information in this article applies to:

SYMPTOMS

A PARAMETER statement placed in the #SECTION 1|2 directive in the setup code of the Screen Builder is not included in the generated screen code.

CAUSE

The documentation suggests indenting the code line(s) as shown in the examples in the FoxPro version 2.5 "Developer's Guide" on page 2-31 (MS-DOS) and page D2-38 (Windows). If the PARAMETER statement is indented with a tab, the statement is ignored and will not be included in the generated screen code.

NOTE: The #SECTION line of code must be the first line of code - it cannot be preceded by any other code.

RESOLUTION

To correct this problem, either remove the tab or indent the PARAMETER statement with spaces instead of a tab. This problem does not occur in FoxPro 2.0 for MS-DOS.

STATUS

Microsoft has confirmed this to be a problem in FoxPro version 2.5 for MS-DOS and Windows. This problem was corrected in FoxPro version 2.5a for MS-DOS and Windows.

MORE INFORMATION

When a #SECTION 1 directive is in the setup code for a screen, this section is searched for a PARAMETERS statement. Regardless of which line contains this statement, the PARAMETERS statement is moved to the line immediately preceding the "Setup Code Section 1" heading in the generated screen code. Any other code under the #SECTION 1 directive is placed immediately after the "Setup Code Section 1" heading. This behavior is desirable since the PARAMETER statement must be the first line of code executed in a program. Providing a #SECTION 1 directive and including the PARAMETERS statement allows the passing of parameters to a program generated by the Screen Builder.

The following sample setup code for TEST.SCX demonstrates how to have the Screen Builder generate code that will allow parameter passing:

   #SECTION 1
   PARAMETER x,y

If this file were generated and then called with the DO TEST.SPR WITH parm1,parm2 command, "x" would take on the value of PARM1, and "y" would take on the value of PARM2.

Additional reference words: FoxDos FoxWin 2.50 2.50a buglist2.50 fixlist2.50a KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxtoolSbuilder

Keywords          : FxtoolSbuilder kbbuglist kbfixlist
Version           : 2.50    | 2.50
Platform          : MS-DOS WINDOWS
Solution Type     : kbfix

Last Reviewed: September 24, 1997