refering to a click procedure

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.
pin_plunderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
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
pin_plunderAuthor Commented:
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
pin_plunderAuthor Commented:
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

kubeerjaCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rwilson032697Commented:
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
pin_plunderAuthor Commented:
That was what i was thinking of.

thanks everybody though.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.