Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming conventions for custom methods?
Message
From
20/11/2008 09:37:32
 
 
To
19/11/2008 17:25:23
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01362229
Message ID:
01363145
Views:
41
>>>What happens if you access (or assign) a property for which you didn't write the code? Your example is exactly the best illustration of my objection: you have to write code to achieve default behavior. You access a property, you get its value returned. You assign it, it gets assigned the value passed. Why the know would you have to write code for that?
>>>
>>>Additionally, what's the syntax for adding a property on the fly?
>>
>>If I didn't write the code? In that case I will be a consumer of the class and can see its PEMs via Visual Studio's class diagram view (toolbar button as well as on the menu). That works for custom classes as well as those that come as part of the .NET framework. If that is what you meant -- not sure.
>>
>>Yes, you have to write code. To me it is very easy to do so, as described in an earlier reply, and a small part of the work involved in writing a class. It's not an issue for me at all.
>
>IOW, you can't have a property if there's no code for it, no matter who wrote it? Next thing you'll tell me there are no array properties...
>
>>I don't know how to add a property on the fly. Maybe one of the more experienced .NET developers here knows a way. Personally I'm not sure it's such a good idea. Can you give me an example of when you might want to do that?
>
>Yes. I can. Why do you want one? To give a solution for that particular case using a workaround?
>
>If it's a bad idea, go tell the Fox team that they screwed up :).

In VFP I would do a check for a form property and if it didn't exist, create it on the fly. I did that mostly because I had to share code with other developers and merge it. In most cases eventually the check never failed and the property existed when code got merged. It wasn't a longterm solution.

You can programmatically add controls to a form at runtime:

http://support.microsoft.com/kb/319266

Properties though I don't know about. I know you can create types at runtime and types can have properties, but I don't think you can add a property to a type at runtime. Maybe you could inherit from it and add a property or something. Still, wouldn't it require reflection since the property wasn't known at compile time? How else could you access it?

This would be a good discussion in the net c# section where the net gurus would see it....
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform