Hi
I am trying to do the following in the uses clause of a form:
Uses
{$IFDEF X}
FormX,
{$ENDIF}
{$IFDEF Y}
FormY,
{$ENDIF}
other units.....;
Form X and FormY has the same name in Delphi - Let's say MyForm.
In other words, If I have a button on the main form of the project, I want to say MyForm.DoSomething on the button's onclick event.
Depending on what conditional directive I specify, I want either formX.DoSomething, or FormY.DoSomething to be executed.
I do however get a duplicate rescource compilation error when trying the above. The two forms are not allowed to have the same name.
I was under the impression that if X was not a conitional directive, Delphi would not even compile, or be aware of formX's existance. Is this so, and if not, how can I address this?
Any help would be appreciated.
Johan Smith
I am trying to do the following in the uses clause of a form:
Uses
{$IFDEF X}
FormX,
{$ENDIF}
{$IFDEF Y}
FormY,
{$ENDIF}
other units.....;
Form X and FormY has the same name in Delphi - Let's say MyForm.
In other words, If I have a button on the main form of the project, I want to say MyForm.DoSomething on the button's onclick event.
Depending on what conditional directive I specify, I want either formX.DoSomething, or FormY.DoSomething to be executed.
I do however get a duplicate rescource compilation error when trying the above. The two forms are not allowed to have the same name.
I was under the impression that if X was not a conitional directive, Delphi would not even compile, or be aware of formX's existance. Is this so, and if not, how can I address this?
Any help would be appreciated.
Johan Smith