Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String is too long to fit
Message
From
28/12/1998 17:47:08
 
 
To
28/12/1998 15:55:17
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00170802
Message ID:
00170980
Views:
32
Hi Nancy,

Your post was helpful in thinking about this some more. After reading it, I tried Erik's code with a "CREATEOBJECT" syntax instead of a "DO FORM" syntax and the error did not occur. So it seems that if the parameter is a property, there is a length limitation of 254 characters when you use the "DO FORM" syntax but not when you use the "CREATEOBJECT" syntax. If the parameter is a memvar then "DO FORM" works regardless of length.

For example,
    oForm2 = CreateObject("myForm2", thisform.myProp)
works regardless of the length of myProp, but
    DO FORM myForm2 WITH thisform.myProp
fails if the length of myProp is 255 or greater. This does seem to be an "undocumented feature"...

>Um, Eric-
>
>Isn't that what I said???
>
>When you DO someProc WITH someVar it is passed by reference. So, when you DO FORM someform WITH someproperty, you get an error precisely because the property can't be passed by reference. IOW, I don't thing it is VFP's bug < s >.
>
>I tried the following:
>set step on
>yoyo = createobject('obj1')
>*!*	do form temp with yoyo.lottatext
>set classlib to temp.vcx
>xoxo = createobject('temp', yoyo.lottatext )
>xoxo.show(1)
>on error
>define class obj1 as custom
>	lottatext = replicate( 'fubar', 100 )
>enddefine
>
>**************************************************
>*-- Class:        temp (d:\nec\temp.vcx)
>*-- ParentClass:  form
>*-- BaseClass:    form
>*
>DEFINE CLASS temp AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 293
>	Width = 625
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT label1 AS label WITH ;
>		WordWrap = .T., ;
>		Caption = "Label1", ;
>		Height = 286, ;
>		Left = 2, ;
>		Top = 1, ;
>		Width = 618, ;
>		Name = "Label1"
>
>
>	PROCEDURE Init
>		lparameter tctext
>		this.label1.caption = tctext
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: temp
>**************************************************
>
>With the result that CREATEOBJECT passed the property just fine.
>
>HTH
>p.s.Cristof Lange's article on parameters in the Jan FPA pointed me in this direction
>
>
>>Form properties are always passed by value, there is no other way. My personal conclusion from playing with it and from reading the posts here is that I have encountered a bug. Good thing there is an easy workaround. This is one for my records...
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform