Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Max Length of User-Defined Property et al
Message
From
23/11/2010 13:09:39
 
 
To
23/11/2010 07:43:43
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01489946
Message ID:
01490270
Views:
130
Hi Doug,

>>from vfp help file:Maximum # of characters per character string or memory variable. 16,777,184
>
>For properties in a class, the maximum length is 8K at design time. If you put a string longer than that into a property, you won't get an error, but you'll corrupt the class and start getting C5 errors.

That is what I had in mind with my first post of:
"If you want to edit via property editor (giiberish or not), you face length problems before running against the typical string limitations of vfp variables of a couple of megabytes, which AFAIK will be the same for properties. If you have to work on REALLY long strings in vfp use single record cursor memo fields."

assuming the length problem to be more a side effect of the editor. But
clea
LOCAL loEmpty, lcAdd
loEmpty = CREATEOBJECT("Custom")
? ADDPROPERTY(loEmpty, "cLongprop", REPLICATE("!", 160))
? loEmpty.WriteExpression("cLongprop", [DTOS(DATE())+SPACE(2)])
? LEN(loEmpty.cLongprop), loEmpty.cLongprop

loEmpty = CREATEOBJECT("Custom")
? ADDPROPERTY(loEmpty, "cLongprop", REPLICATE("!", 160))
? loEmpty.WriteExpression("cLongprop", [DTOS(DATE())+SPACE(2000)])
try
? LEN(loEmpty.cLongprop), loEmpty.cLongprop
catch
? "WTF Len WriteExpression"
endtry

loEmpty = CREATEOBJECT("Custom")
? ADDPROPERTY(loEmpty, "cLongprop", REPLICATE("!", 16000000))
? LEN(loEmpty.cLongprop),

loEmpty = CREATEOBJECT("Custom")
try
? ADDPROPERTY(loEmpty, "cLongprop", REPLICATE("!", 1600000000))
catch
? "oops"
endtry

lcAdd = REPLICATE("!", 1000000)
loEmpty = CREATEOBJECT("EMpty")
? ADDPROPERTY(loEmpty, "cLongprop", "")
FOR lnRun = 1 TO 22
	loEmpty.cLongprop = loEmpty.cLongprop + m.lcAdd
	? lnRun, LEN(loEmpty.cLongprop)
next
I always assumed that during "pure runtime" any property could be filled between 8K and 16MB like regular memvars

regards

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform