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.)

-- 
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to