?
Solved

How to display a message before other component display it own message ?

Posted on 2003-10-28
8
Medium Priority
?
187 Views
Last Modified: 2010-04-05
I have 3 components, if I add it to a form, it always display each own message when open the application before display my own message, how can i add a message before other components display it own message ?

example I try to add like this

  showmessage('I'm the 1st Message');
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;

but still cannot display my message first before other messages.
Anyone can help me in this problem ? Thanks.
0
Comment
Question by:matrixworld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9633052
?? what for a message
0
 
LVL 10

Expert Comment

by:kacor
ID: 9633250
- which components you have?
- are connected special messages to this components?
wbr Janos
0
 
LVL 10

Expert Comment

by:kacor
ID: 9633349
I made for you a simple demoproject:
There are 3 Buttons on Form1 having each of them fast the same message:

procedure TForm1.Button1Click(Sender: TObject);
begin
   showmessage('I am the Button1');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
   showmessage('I am the Button2');
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
   showmessage('I am the Button3');
end;

And they appear after pressing the buttons.
But I created the first message too connected to the On Create event of the form which appears before creating the form1:

procedure TForm1.FormCreate(Sender: TObject);
begin
   showmessage('I am the 1st message');
end;

Otherwise your statement
        showmessage('I'm the 1st Message');
is wrong because you have to doble the ' character:
        showmessage('I''m the 1st Message');

I hope I could help

wbr
Janos
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Accepted Solution

by:
geobul earned 120 total points
ID: 9633815
Hi,

Add this at the end of your main form:

initialization
  showmessage('I''m the 1st Message');

end.

Regards, Geo
0
 

Author Comment

by:matrixworld
ID: 9638458
Hi Geo,
   your method is working unless I create a component with initialization and then place it before other components under uses call, is that any possible to do it before the uses call ? Thanks & Regards.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9640029
Hi,

Make a new unit with the code above only and add that unit on the first place in main form's uses clause.

Regards, Geo
0
 
LVL 1

Expert Comment

by:ttd
ID: 9640329
Hi,

Try to debug your application from the very first step by pressing F7 in the IDE, you will learn how units will be initialized, which order components are created in, and so on. You will found the right place to put your message. Very simple, isn't it?

Regards,

ttd
0
 

Author Comment

by:matrixworld
ID: 9648785
Hi Geo,

   How can I set a variable under initialization example like below

initialization
  sTest := 'This is testing';
  showmessage('I''m the 1st Message');


Thanks & Regards,
Peter Oh
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question