FIX: Error Caused by Object-Level Reference to #WNAME Window

Last reviewed: October 14, 1997
Article ID: Q105505
2.50 WINDOWS kbprg kbfixlist kbbuglist kberrmsg

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.5

SYMPTOMS

An object-level clause that refers to a window name defined by the #WNAME generator directive causes the Screen Builder to generate two lines of code for that clause.

The first line uses the random window name created by the Screen Builder during program generation; the second uses the window name defined by #WNAME.

STATUS

Microsoft has confirmed this to be a problem in FoxPro 2.5 for Windows. This problem was corrected in FoxPro 2.5a for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Use the Screen Builder to create a new screen.

  2. From the Screen menu, choose Layout. Under Options, choose the Code button. Then choose the Screen Setup Code button. Choose OK twice to go to the Setup Snippet window.

  3. In the Setup Snippet window, type the following:

    #WNAME somename

    Close the Setup Snippet window to return to the Screen Design window.

  4. Create an input (GET) field.

  5. In the Field dialog box, choose Input. In the Choose A Field Or Variable text box, type "x" (without the quotation marks). Choose OK to return to the Field dialog box.

  6. In the Field dialog box, under Clauses, choose the Valid button. Verify that Procedure is selected in the Code Snippet dialog box. Type the following code in the text box:

    ACTIVATE WINDOW somename

    Choose OK twice to return to the Screen Design window.

  7. Save the screen as TEST.SCX (assuming you do not already have a file with the same name). When asked to "Save environment information?", choose No.

  8. Generate TEST.SPR, and then close the Screen Design window.

  9. Run TEST.SPR.

  10. Press the TAB key once to activate the VALID clause.

    The following program error is generated:

    WINDOW 'SOMENAME' has not been defined.

  11. Choose Cancel from the Program Error message box.

The TEST.SPR file is automatically opened. Note that the ACTIVATE WINDOW command appears twice. The first command uses the random window name generated by the Screen Builder; the second uses the window name "somename."

For example, the code will look similar to the following (the generator-named window, "_qjm0tqik8," will be different, however):

   ACTIVATE WINDOW _qjm0tqik8
   ACTIVATE WINDOW somename


Additional reference words: FoxWin 2.50 buglist2.50 fixlist2.50a errmsg err
msg WHEN
KBCategory: kbprg kbfixlist kbbuglist kberrmsg
KBSubcategory: FxtoolSbuilder
Keywords : FxtoolSbuilder kbbuglist kberrmsg kbfixlist kbprg
Version : 2.50
Platform : 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: October 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.