Wow!
I didn't know about that. Of course there is nothing about that in
Borland's help file.
Anyway that IDE crash gave me the lesson so I left the
'Application.Title' unchanged and I use a different approach now.
Also, I will try to move my code out from DPR as you suggested. I need
to insert code before 'create forms' and after 'create forms'. It was
much easier to read the code while it was all there.
Thank you very much Rob.
Rob Kennedy wrote:
> CubicDesign wrote:
>
>> *begin
>> Application.Initialize;
>> Application.Title := 'Crash me';
>> ...
>> if NOT TrialAlreadyAnouncedToday (Application.Title)
>> then... < guilty
>> Application.Run;
>> end.*
>>
>>
>>
>>
>> If I change the line
>> if NOT TrialAlreadyAnouncedToday (Application.Title) then...
>> in
>> if NOT TrialAlreadyAnouncedToday ('Application.Title') then...
>> it works.
>>
>
> The expression "Application.Title" must not appear more than once in the
> DPR file, and when it appears, it must be on the left in an assignment
> statement. That expression is special since the IDE needs it for
> populating the project-options dialog, as well as for getting its
> bearings on the compiler-generated code.
>
> I've solved it like this:
>
> var
> App: TApplication;
> begin
> App := Application;
> App.Title := ComputeAppTitle;
> end;
>
> I've also seen it done like this:
>
> with Application do
> Title := ComputeAppTitle;
>
> Also, the IDE is less apt to get confused if you keep code in the main
> begin-end block to a minimum. I put most of the other code in separate
> routines that I call from the main block. (But "Application.Title" can't
> appear in those other DPR routines, either. Putting them in a separate
> unit is fine.)
>
>
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi