Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a read-only property
Message
From
23/12/2004 00:41:10
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00971675
Message ID:
00971682
Views:
19
Meaning, I will add an empty property_Assign method without actually assigning the parameter passed? That works for me. Thanks.

>You've to use Assign method to make property read-only. The COMMATTRIB is used to populate COM object type library.
>
>>Hi all, How do I create a read-only property?
>>
>>* Example: Project file: MyBizObjs (dll)
>>#DEFINE COMATTRIB_READONLY 0x100000
>>define class bizobjs as session olepublic
>>   MyReadOnlyProperty = "Hello"
>>   dimension MyReadOnlyProperty_COMMATTRIB[4]
>>   MyReadOnlyProperty_COMMATTRIB[1] = COMATTRIB_READONLY
>>enddefine
>>
>>I can still assign a value to the property: MyReadOnlyProperty by running this code:
>>
>>obo = createobject('mybizobjs.bizobjs')
>>? obo.MyReadOnlyProperty && displays Hello
>>obo.MyReadOnlyProperty = "World!"
>>? obo.MyReadOnlyProperty && displays World!
>>
>>Is there something else that I'm missing?
ramil
~~ learning to stand still
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform