Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Error on .AddProperty
Message
From
28/02/2009 13:06:15
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01384470
Message ID:
01384765
Views:
52
>>>> Good extra point. Add a check for vartype(lnWidth) and adjust accordingly.
>>
>>I think you are missing the issue, or I am not explaining very well.
>>
>>The Width is there, it is numeric and I can see it.
>>
>>The error occurs when AddProperty() is called, since it's a new property I am adding and since I pass in the value, there should be no possibility of a data type mismatch, but that is what I get.
>
>Yes, I was just thinking about it. I got some weird effects with controls inside the grid long time ago. Is there any way to avoid using AddProperty in your case?
>
>BTW, do you have Access or Assign method for Width in some of your controls?

But wouldn't the error (of assigning a date to .width, for example) happen in these methods, and not on the addproperty line?
Still, you may be into something there. The addproperty() takes arbitrary values, you can assign anything to a property UNLESS it's a built-in property with a specified type and range. Now if it was out of range we'd have a different value. Since Gary has already checked for the .width (being a number), then the remaining thing is to see whether the target property is perhaps defined somewhere as of a different type.

Like I said in the other message, the crucial test would be to rename the property, or at least to try to assign the .width to a property of a different name first.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform