Board index » cppbuilder » OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.


2007-03-03 02:24:13 AM
cppbuilder35
I have two descentants of TDataModule.
i.e. Descendant2 descends from Descendant1 descends from TDataModule.
I can change OldCreateOrder for Descendant1 and the .dfm file will always
contain and OldCreateOrder statement with a value of either true or false.
I have Descendant1 set to OldCreateOrder = false.
I open Descendant2 and Property inspector shows OldCreateOrder of true.
I change OldCreateOrder to false, save it, and close Descendant2. The .dfm
for Descendants does not contain an OldCreateOrder statement.
I open Descendant2 and Property inspector shows OldCreateOrder of true.
??? Why ???
I save Descendant2 with its OldCreateOrder of true and close Descendant2.
The .dfm for Descendant2 does contain an OldCreateOrder = true statement.
I open Descendant2 and Property inspector shows OldCreateOrder of true. (As
expected)
Why can I not set the 2nd descendants OldCreateOrder to false and have it
show up in the Property Inspector the next time I open it.
 
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

"Larry Griffiths" < XXXX@XXXXX.COM >wrote in message
Quote
I open Descendant2 and Property inspector shows OldCreateOrder of
true.
Like in TCustomForm, the OldCreateOrder property of TDataModule is not
initialized from the DFM. It is initialized dynamically when the
TDataModule is created, before the DFM is streamed in. OldCreateOrder
is initialized to False if the module was compiled for C++, and
initialized to True if not. The DFM is then streamed in after that.
However, TDataModule determines whether the module is compiled for C++
the same way that TCustomForm does (the global ModuleIsCpp variable),
which is not always accurate, especially if you are importing a
project from an older version of BCB.
Why are you relying on OldCreateOrder to begin with? You shouldn't
be.
Quote
I change OldCreateOrder to false, save it, and close Descendant2.
The
.dfm for Descendants does not contain an OldCreateOrder statement.
It is not supposed to. The default value for boolean properties is
False, and there is no 'nodefault' or 'stored=true' clause on the
property, so the value will not be stored if it is currently False
when the DFM is generated. That is how the DFM works in general.
Quote
I open Descendant2 and Property inspector shows OldCreateOrder
of true. ??? Why ???
Because the VCL startup code is reporting that the module was not
compiled for C++ in the first place.
Quote
I save Descendant2 with its OldCreateOrder of true and close
Descendant2.
The .dfm for Descendant2 does contain an OldCreateOrder = true
statement.
As it should be, since True is not the default value for the property.
Quote
Why can I not set the 2nd descendants OldCreateOrder to false and
have it show up in the Property Inspector the next time I open it.
Since you did not show your code, my guess would be that you did not
override the declaration of the OldCreateOrder property to force the
DFM to store the property regardless of whether it is set to the
default value or not.
Gambit
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

Wow! The War and Peace Novel Gambit style :)
What we see is code in Forms.pas "procedure TCustomForm.ReadState(Reader:
TReader);"
if ClassParent = TForm then
FOldCreateOrder := not ModuleIsCpp;
but "procedure TDataModule.ReadState(Reader: TReader);" in Classes.pas
does not contain an if ClassParent = TDataModule;
Can I Add this statement to Classes.pas and make it active in vcl.lib etc.
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Larry Griffiths" < XXXX@XXXXX.COM >wrote in message
news:45e86bb6$ XXXX@XXXXX.COM ...

>I open Descendant2 and Property inspector shows OldCreateOrder of
true.

Like in TCustomForm, the OldCreateOrder property of TDataModule is not
initialized from the DFM. It is initialized dynamically when the
TDataModule is created, before the DFM is streamed in. OldCreateOrder
is initialized to False if the module was compiled for C++, and
initialized to True if not. The DFM is then streamed in after that.

However, TDataModule determines whether the module is compiled for C++
the same way that TCustomForm does (the global ModuleIsCpp variable),
which is not always accurate, especially if you are importing a
project from an older version of BCB.

Why are you relying on OldCreateOrder to begin with? You shouldn't
be.

>I change OldCreateOrder to false, save it, and close Descendant2.
The
>.dfm for Descendants does not contain an OldCreateOrder statement.

It is not supposed to. The default value for boolean properties is
False, and there is no 'nodefault' or 'stored=true' clause on the
property, so the value will not be stored if it is currently False
when the DFM is generated. That is how the DFM works in general.

>I open Descendant2 and Property inspector shows OldCreateOrder
>of true. ??? Why ???

Because the VCL startup code is reporting that the module was not
compiled for C++ in the first place.

>I save Descendant2 with its OldCreateOrder of true and close
Descendant2.
>The .dfm for Descendant2 does contain an OldCreateOrder = true
statement.

As it should be, since True is not the default value for the property.

>Why can I not set the 2nd descendants OldCreateOrder to false and
>have it show up in the Property Inspector the next time I open it.

Since you did not show your code, my guess would be that you did not
override the declaration of the OldCreateOrder property to force the
DFM to store the property regardless of whether it is set to the
default value or not.


Gambit


 

{smallsort}

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

You want to know what I think, Gambit. LOL
I see a few places where this has cropped up since the year 2000.
qc.borland.com/wc/qcmain.aspx
qc.borland.com/wc/qcmain.aspx
groups.google.com/group/borland.public.cppbuilder.ide/browse_thread/thread/577a5207ca119f1e/78664268eff7e9d1
I think all the OldCreateOrder stuff should be yanked out of the VCL.
Maybe a poll question and if at least 90% agree, then nuke it!
:)
Larry
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

"Larry Griffiths" < XXXX@XXXXX.COM >wrote in message
Quote
What we see is code in Forms.pas "procedure
TCustomForm.ReadState(Reader:
TReader);"

if ClassParent = TForm then
FOldCreateOrder := not ModuleIsCpp;
I guess you are looking in BDS, correct? BCB 6 and earlier do not
check the ClassParent.
Quote
Can I Add this statement to Classes.pas
Yes.
Quote
and make it active in vcl.lib etc.
No. Borland does not allow the VCL library to be recompiled. The
only thing you can do is turn off the use of runtime packages in the
Project Options and then add the modified file to your project.
Gambit
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

Quote
I guess you are looking in BDS, correct? BCB 6 and earlier do not
check the ClassParent.

Yes, This is BDS 2006 code I am looking out.
Geez, Gambit, I got to thinking that I have been reading posts from you and
Chris for a couple of decades now. Are either one of you close to
retirement? LOL
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

Quote
I think all the OldCreateOrder stuff should be yanked out of the VCL.

Maybe a poll question and if at least 90% agree, then nuke it!

Hmm, I hear Devo singing in the background...
crack that whip
give the past the slip
step on a crack
break your momma's back
when OldCreateOrder comes along
you must nuke it
before the cream sits out too long
you must nuke it
when something's going wrong
you must nuke it
now nuke it
into shape
shape it up
get straight
go forward
move ahead
try to detect it
it's not too late
to nuke it
nuke it good.
LOL
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

"Larry Griffiths" < XXXX@XXXXX.COM >wrote in message
Quote
Geez, Gambit, I got to thinking that I have been reading posts from
you
and Chris for a couple of decades now. Are either one of you close
to
retirement? LOL
Not even close. I'm in my late twenties, and I think Chris is, too.
I'll retire when I win the lottery, though ;-)
Gambit
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

"Larry Griffiths" < XXXX@XXXXX.COM >writes:
Quote
>I guess you are looking in BDS, correct? BCB 6 and earlier do not
>check the ClassParent.
>

Yes, This is BDS 2006 code I am looking out.

Geez, Gambit, I got to thinking that I have been reading posts from
you and Chris for a couple of decades now. Are either one of you
close to retirement? LOL
I just turned 34. I guess I am a geezer when it comes to the world of
tech. :)
--
Chris (TeamB);
 

Re:OldCreateOrder for TDataModule Descendant after 1st Descendant is always true in BDS 2006.

Well Im 50 so I guess that makes me a geezer's geezer. LOL
"Chris Uzdavinis (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
"Larry Griffiths" < XXXX@XXXXX.COM >writes:

>>I guess you are looking in BDS, correct? BCB 6 and earlier do not
>>check the ClassParent.
>>
>
>Yes, This is BDS 2006 code I am looking out.
>
>Geez, Gambit, I got to thinking that I have been reading posts from
>you and Chris for a couple of decades now. Are either one of you
>close to retirement? LOL

I just turned 34. I guess I am a geezer when it comes to the world of
tech. :)

--
Chris (TeamB);