[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

refering to a click procedure

Posted on 2000-01-21
6
Medium Priority
?
118 Views
Last Modified: 2010-04-04
I'm writing a calculator program.
and got this problem:

if Num1 <> 0 then
   btnIgualClick(btnResta)
 else
   Num1 := StrToFloat(edtCalculus.Text);

when i ran this code step by step, it was clear for me to understand why my program wasn't working. I'll explain myself, when the compiler reached the line which refers to btnIgualClick it was like if it read it and then skipped it. At least it seemed that to me as it didn't jump to that procedure (btnIgualClick).

which is the problem here?

thanks.
0
Comment
Question by:pin_plunder
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2375398
The procedure is an OnClock event which is handled in the VCL.

To step into the Onclick procedure you will need to compile the VCL code into your app. To do this add $(Delphi)\source\vcl and recompile your program.

Cheers,

Raymond.
0
 

Author Comment

by:pin_plunder
ID: 2377554
I'm sorry, but first of all I've tryied what you told me and didn't work. Maybe I'm not doing it correctly...
However, I don't like the idea to 'add' all the VCL to my program, isn't there an easier way?

Thanks.
0
 

Author Comment

by:pin_plunder
ID: 2377562
I'm sorry, but i don't like the idea of adding the VCL to my program, so isn't there an easier way to accomplish this?

thanks.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
LVL 2

Accepted Solution

by:
kubeerja earned 30 total points
ID: 2377732
why don't you put the code in a seperate procedure and call this procedure in both events btnIgualClick and btnRestaClick like this

procedure TForm1.btnIgualClick(Sender: TObject);
begin
 proccessnumbers ;
end;

procedure TForm1.btnRestaClick(Sender: TObject);
begin
if Num1 <> 0 then
   proccessnumbers ;
 else
   Num1 := StrToFloat(edtCalculus.Text);
end;

procedure TForm1.Proccessnumbers ;
begin
  {your code here}
end;
 
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2377759
But you're already compiling the VCL in - it's normally just linked in as DCUs. What I suggested was to compile the VCL source (assuming you have Delphi Pro which includes it).

Cheers,

Raymond.
0
 

Author Comment

by:pin_plunder
ID: 2379239
That was what i was thinking of.

thanks everybody though.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

613 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