BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

default value ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Mansour
Guest





PostPosted: Thu Aug 28, 2003 11:45 am    Post subject: default value ? Reply with quote



Hi,
I define property :
__property bool Look3D = { read=FLook3D, write=FLook3D, default=1 };

but in object inspector default value is false !
whats problem ?


Thanks M.T



Back to top
Ralph Kazemier
Guest





PostPosted: Thu Aug 28, 2003 12:53 pm    Post subject: Re: default value ? Reply with quote




"Mansour" <sasan_vm (AT) yahoo (DOT) com> wrote

Quote:
Hi,
I define property :
__property bool Look3D = { read=FLook3D, write=FLook3D, default=1 };

but in object inspector default value is false !
whats problem ?

The VCL streaming system will only write the value of a property to dfm when
its value does not equal the default value (or when no default value is
specified). The default specifier only *informs* the VCL streaming system
what the default value for a property is. The component itself is
responsible for actually initializing the property with its default value.
The best place to do this is the constructor. You probably did not do that.
Which would result in a false value for a boolean (by default all the memory
a VCL class instance holds is nulled out).


Ralph




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.