Microsoft KB Archive/221739

= FIX: Error Using Object Property > 255 Characters As Parameter =

Article ID: 221739

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q221739



SYMPTOMS
You have an object property that is a character string of length 255 characters or longer. You attempt to pass this property as a parameter to a form Init method using the DO FORM WITH syntax. When the DO FORM command is executed, the following error is generated:

String is too long to fit.



RESOLUTION
Upgrade to Visual Studio 6.0 Service Pack 3 or try the workarounds below:   Pass the property as a named expression: DO FORM testxx WITH (lObj.cText)   Store the property value to a variable and pass the variable to the form Init: LOCAL lcTxt lcTxt = lObj.cText DO FORM testxx WITH lcTxt 



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed



Steps to Reproduce Behavior
  Run the following code from a program (.PRG) file: Local aobj[1], xx Create FORM testxx NOWAIT =ASELOBJ(aobj,1) xx = aobj[1] xx.autocenter = .t. xx.WriteMethod('init',[LPARA tcInitString] ;  + chr(13)+ [? tcInitString]) Keyboard 'Y' CLEAR Release WINDOW 'Form Designer - testxx.scx'

Local lobj, lofrm1, lctxt lobj = CREATEOBJECT('obj1')       && Create an object with a text property Do FORM testxx WITH lobj.cText    && This command produces the error: Return

Define CLASS obj1 AS CUSTOM cText = REPLICATE( 'X', 255 ) Enddefine  The error above is displayed. This is error number 1903.</ol>

(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Jim Saunders, Microsoft Corporation.

Keywords: kbbug kbfix kboop kbctrl kbvs600sp3fix KB221739

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.