Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's happening here ?
Message
From
27/02/2005 12:54:50
 
 
To
27/02/2005 11:21:26
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
00990234
Message ID:
00991006
Views:
15
Hi,

>>
Underscoring this thread is that it's very questionable practice to put *any* VFP expression in class constructor code, unless you really know what you're doing. Why? Because that code is "run" (such as it is) when the first object is created, and never again while that class definition is in memory.

I'm glad to see that at least VFP 9 prevents you from doing this with *objects*. In a code review, I would flag *any* use of an expression in constructor code for examination.
>>

But VFP9 doesn't prevent it. It tells you it's illegal then goes ahead anyway..

IAC, the behaviour could be useful. Maybr it might make more sense to change things so that an object *could* be properly created in this way - it would be a simple way of giving all instances of an object the ability to share properties, variables or data.

Regards,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform