Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Missing classes in Class Browser?
Message
From
10/02/2003 00:33:22
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00751108
Message ID:
00751280
Views:
29
>The documetation is currently correct. You can only use the Empty class in a PRG, not in the VCX system.
>

Ken,

Once again, with all due respect, this is NOT correct. I used the empty class in a VCX based class just fine. I create a line in a vcx. Here is the code:

*TestEmpty::Init()
ADDPROPERTY(This, 'EmptyClass')

WITH This
.EmptyClass = createobj('Empty')

ADDPROPERTY(.EmptyClass, 'First',1)
ADDPROPERTY(.EmptyClass, 'Second',2)
ADDPROPERTY(.EmptyClass, 'Third',3)


.Enumerate()

ENDWITH

*TestEmpty::Enumerate()
LOCAL OutString AS Character

OutString = ""

WITH This.EmptyClass

OutString = OutString + 'First ='+TRANSFORM(.First)+CHR(10)
OutString = OutString + 'Second ='+TRANSFORM(.Second)+CHR(10)
OutString = OutString + 'Third ='+TRANSFORM(.Third)+CHR(10)

MESSAGEBOX(OutString)
ENDWITH


***********
So, it seems I 'used' the empty class in a VCX.


>You cannot subclass the Empty class at all, but the documetation does not say that you can. In fact, the docs do state:
>The Empty base class contains no intrinsic properties, methods or events. You cannot subclass or add custom methods and events to the Empty class. However, at run time, you can add custom properties using the ADDPROPERTY( ) function or the SCATTER NAME...ADDITIVE command.

Exactly, and this is true whether you try to DEFINE a class as empty in a PRG or a VCX. I think the doc writers confused this class which you CAN'T EVEN DEFINE/SUBCLASS with a class like session which you can only define in a PRG.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform