Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form array property vs many properties?
Message
From
04/02/2008 13:27:19
 
 
To
04/02/2008 12:37:36
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01288030
Message ID:
01289171
Views:
18
>>>Depending on what you want. Thisform.AddProperty("oProp", "Empty") will be a string. Thisform.AddProperty("oProp", createobject("Empty")) will be an Empty object - a live object at that, which can be assigned properties, i.e. a full object of class Empty (sounds like a paradox, I know).
>>>
>>>If you initialize it as a .null, I really don't know what type will it be - and VFP probably doesn't know either. I initialize a property to .null. if I plan to make it an object reference later, just as a matter of style, the .null. being some sort of intuitive value for "no object", just like "" means "no string".
>>
>>Well, we know that we want to initialize it with the SCATTER NAME command, which creates an object. So, I assumed we may want to initialize it with NULL <g>, which is different from default .f.
>
>No objection either way - was just pointing out the differences. Any of these would work... though I'd agree that setting up a property with a value of "Empty" (as a string) or of an empty object (but still a live object) would then be, ahem, overkill - the Scatter Name object would discard whatever was in there and put a new object there instead.

In a well written Fwk this would always be the case. But as you sometimes have to work with troublesome code, can you ALWAYS guarantee that the scatter happens before some unruly chain calls gather ?
CREATE CURSOR te (tx c(20))
local loS
loS = CREATEOBJECT("empty")
INSERT INTO te FROM NAME loS
loS = .null.
INSERT INTO te FROM NAME loS
*-- or thiw might just be logically working, even if by strange design...
loS = CREATEOBJECT("empty")
gather NAME loS
loS = .null.
gather NAME loS   && but this will test your errorhandler
regards

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform