DOC: Code on Pages 75-76 of Developer's Guide Causes Error

Last reviewed: January 8, 1997
Article ID: Q139110
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

When you use the code example listed on pages 75-76 of the Developer's Guide, the following error occurs:

   Error with <ObjectName>- Height: Expression evaluated
   to an illegal value

This documentation error has been fixed in Visual FoxPro 5.0 for Windows.

MORE INFORMATION

The error occurs because 12 is not a valid size for the Height property of the object when the ScaleMode property is set to 3 (Pixels). The default ScaleMode property of the form is set to Pixels, and the object is designed to use Foxels, even though there is a line in the DEFINE CLASS grdProducts AS Grid stating:

   ScaleMode = 0

The ScaleMode property is a property of the form, not the grid.

To use the code example, make these two changes:

  1. Move the ScaleMode property into the code for the DEFINE CLASS GridForm AS FORM.

  2. Place "Height = 12" in the PROCEDURE INIT of the grid.

By the time the grid is to be shown, the form's ScaleMode property will now be set to 0 (Foxels).

After you make the two changes, the code from the Developer's Guide should look like this:

   DEFINE CLASS GridForm AS FORM
       ScaleMode = 0
       <other statements>
   ENDDEFINE

   DEFINE CLASS grdProducts AS Grid
    <other statements>

     PROCEDURE INIT
       This.Height = 12
     ENDPROC

   ENDDEFINE


KBCategory: kbprg kbdocerr kbdocfix
KBSubcategory: FxotherDochelp
Additional reference words: docerr 3.00 VFoxWin 5.00


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