PRB: Syntax Error If VB CDK Custom Property Name Starts w/ Num

Last reviewed: June 21, 1995
Article ID: Q78399
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, version 2.0
- Microsoft Visual Basic programming system for Windows, version 1.0

SYMPTOMS

When a control property starts with a numeric value, Visual Basic generates this syntax error:

   Expected: end-of-statement.

However, the property works correctly in the Visual Basic design mode from the Properties bar (or window in version 2.0).

CAUSE

The Property Name (npszName) field in the PROPINFO structure for the Visual Basic Control Development Kit (CDK) cannot start with a numeric value.

RESOLUTION

This information needs to be added to page 143 of the "Microsoft Visual Basic: Control Development Guide" shipped with Microsoft Professional Toolkit for Visual Basic 1.0 for Windows, or page 132 of the "Microsoft Visual Basic: Control Development Guide" shipped with the earlier CDK add-on for Microsoft Visual Basic.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Rebuild the Circle3 example provided with the CDK after changing the PROPINFO Property_FlashColor structure in CIRCLE3.H to the following:

    PROPINFO Property_FlashColor = { "2FlashColor", DT_COLOR | PF_fGetData | PF_fSetData | PF_fSaveData | PF_fEditable, OFFSETIN(CIRCLE, FlashColor) } ;

  2. While in Visual Basic development environment (VB.EXE) with the Circle3 control loaded, assign the 2FlashColor property a value:

          Circle1.2FlashColor = 2
    

  3. Press F5 to generate the "Expected: end-of-statement" error message. The text "FlashColor" will be selected for the syntax error.


Additional reference words: docerr noupd 1.00 2.00
KBCategory: kbprg kbdocerr kbprb
KBSubcategory: TlsCDK


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