Board index » delphi » Property not found (Delphi5 and Delphi6)

Property not found (Delphi5 and Delphi6)

Is it possible to ignore reading a property at runtime.
(Ok: I can change the file classes.pas)

I have a form with a TPagecontrol.
There is a new property TabIndex for Delphi 6 in the class TpageControl.

When I compile the program with Delphi6, the Exe file works fine.

But if I compile the program with Delphi5, the execution of the Exe file
stops.
I get the message error reading Form2.TabIndex. Property TabIndex does not
exist.
(Ok: Before compiling in Delphi5 I can open then Unit and click Ignore for
this property in the IDE)

Is there an other way to use a Form with a new property of a new Delphi
version in an older Delphi version ?

Thanks

Andy

 

Re:Property not found (Delphi5 and Delphi6)


Yes, but it's much hassle.
1. you have to override TCustomForm.Create and practically copy code
2. create your own InitInheritedComponent that reads component with your
TReader descendent class that assigns OnError handler.

You really shouldn't change classes.pas.
--
Robert

Quote
Andreas Klapperich wrote in message <3b5d6e64_2@dnews>...
>Is it possible to ignore reading a property at runtime.
>(Ok: I can change the file classes.pas)

>I have a form with a TPagecontrol.
>There is a new property TabIndex for Delphi 6 in the class TpageControl.

>When I compile the program with Delphi6, the Exe file works fine.

Re:Property not found (Delphi5 and Delphi6)


In article <3b5d6e64_2@dnews>, "Andreas Klapperich" <AKlapper...@Rowa.de>
wrote:

Quote
> Is there an other way to use a Form with a new property of a new Delphi
> version in an older Delphi version ?

1.
Open form2.Dfm;
Edit out the references to the Tabindex property. Be careful! (and back it
up first!).

2. Abandon RAD altogether, create all components at run-time. Use an $define
in the project to control it.
$ifDef COMPILEWITHDELPHI6
  TabIndex:=4;
$Endif

3.
(What I actually do).
Edit DFM's *only* in the *older* version and copy them to the project to be
compiled with the later version.
Edit PAS files in the later version wrapping references to new properties in
an IfDef as in 2.

Other Threads