[DUG] Zero-valued Real Properties not being stored to .DFMfile???(D7 Enterprise)

Moretti, Giovanni G.Moretti at massey.ac.nz
Wed Dec 7 12:22:23 NZDT 2005


> From: delphi-bounces at ns3.123.co.nz
[mailto:delphi-bounces at ns3.123.co.nz] On Behalf Of Todd Martin



> I suppose there is a good reason why the constructor sets the X value
to 1.0, but is it 

> absolutely necessary, since it can be set at design time in the object
editor?

 

It could be done at design time but this is for an OpenGL component and
the viewer position is set so that - with the default values - there is
something (a cube) that can be seen BEFORE the user adds their own paint
method/drawing commands. Having spent many hours getting lost with
misunderstanding of how everything works, I thought I'd make the default
values display something sensible.

 

Anyway, even apart from that, if you specify zero - if it's not going to
store the value you specify for you (which it should), then a warning
message should be displayed!

 

Cheers

Giovanni

 

	----- Original Message ----- 

	From: Moretti, Giovanni <mailto:G.Moretti at massey.ac.nz>  

	To: NZ Borland Developers Group - Delphi List
<mailto:delphi at ns3.123.co.nz>  

	Sent: Thursday, December 01, 2005 3:42 PM

	Subject: [DUG] Zero-valued Real Properties not being stored to
.DFM file???(D7 Enterprise)

	 

	I'm using Delphi 7 Enterprise and I've finally tracked down why
some properties that can be changed in the object inspector don't have
any effect.

	 

	I've written a component that contains a real Published Property
X of type REAL:

	 

	 - X is initialised in the Constructor to +1

	 

	 - I change X to ZERO using the object inspector

	 

	 - I run the program and find that X still has its initialised
value (+1)

	 

	AAARGH - it's taken quite a while to find out why and it's (as
usual) a single line buried in the help:

	 

	"STORAGE SPECIFIERS"

	  "For Reals, pointer and strings there is an implicit default
value of ZERO"

	 

	And it seems the values aren't streamed from the object
inspector into the .DFM file unless they differ from the ASSUMED default
(which is to be ZERO but in my case is actually +1 !!!

	 

	To me this seems like a definite bug - you change a value in the
Object Inspector at Design-time but it doesn't make it to the .DFM file
and has no effect on the executable.

	 

	Setting STORED on the Property line doesn't help and for Reals
you can't specify a DEFAULT value).

	 

	Has this been fixed in later versions of Delphi? 

	 

	Any suggested work-arounds (such as storing 1E-8 instead of
zero). This component has several sets of X/Y/Z coords and I really
don't want have to maintain another a dozen tiny procedures each of
which changes zero to 1E-8 ...

	 

	Thanks

	Giovanni

	
=====================================================================

	Giovanni Moretti  |  Institute of Information Sciences and
Technology

	Senior Lecturer   |  Massey University, Palmerston North, New
Zealand

	Computer Science  |  Ph 64-6-3505799x2474 =Fax 64-6-3502259 ==
ZL2BOI 

	
=====================================================================

	http://www-ist.massey.ac.nz/moretti
mailto:G.Moretti at massey.ac.nz

	 

	
  _____  


	_______________________________________________
	Delphi mailing list
	Delphi at ns3.123.co.nz
	http://ns3.123.co.nz/mailman/listinfo/delphi

	
  _____  


	No virus found in this incoming message.
	Checked by AVG Free Edition.
	Version: 7.1.362 / Virus Database: 267.13.10/188 - Release Date:
29/11/2005

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20051207/62b00b6c/attachment.html


More information about the Delphi mailing list