[1] I have a procedure :
procedure TfMTr_.A19btnBkPostDeb_Click(Sender: TObject);
begin
<some code>
cChangerate := dmMCR_.tBK_Changerate_.Value;
cBkAmount := dmMCR_.tBK_BkAmnt_.Value;
sCurrency := dmMCR_.tBK_Currency_.Value;
<more code>
end;
[2] then I added this procedure for different changerates :
procedure TfMTr_.A19btnRate1_Click(Sender: TObject);
begin
Changerate := 0;
sCurrency := '';
cVrAmount := dmMCR_.tBK_VrAmnt_.Value;
{[Changerate 1.75 Currency = usd]}
if (Sender = A19btnRate1_) or (Sender = A17btnRate1_) or
(Sender = EbtnRate1_) or (Sender = A24btnRate1_) then
begin
cChangerate := 1.75;
sCurrency := 'usd';
end;//*if (Sender = A19btnRate175_) or
<more code for different changerates>
if ((sCurrency <> '') and (cChangerate <> 0)) then
begin
cBkAmount := CalcBkAmount(cChangerate,cVrAmount);
dmMCR_.tBK_.Edit;
dmMCR_.tBK_BkAmnt_.Value := cBkAmount;
dmMCR_.tBK_Currency_.Value:= sCurrency;
dmMCR_.tBK_Changerate_.Value := cChangerate;
end;
end;
[3] procedure 2 uses 2 functions:
function CalcBkAmount(rate, vramount : currency) : currency;
begin
Result := RoundCurr(rate * vramount);
end;
function RoundCurr(inputAmount : Extended): Extended;
var
rNr ,rFrac, rTrunc , rCalc: Real;
begin
rNr := inputAmount * 100;
rTrunc := Int(rNr);
rFrac := rNr - Int(rNr);
if rFrac >= 0.5 then rTrunc := rTrunc + 1; //*
Result := rTrunc / 100;
end;
In runtime when clicking the A19btnBkPostDeb_ button
from procedure 1 the window is closed.
When I put a Showmessage()in the procedure or step
with the debugger I come to the conclusion that
the procedure is not executed, but instead
the following procedure is executed???.
procedure TfMTr_.ExitApplication1Click(Sender: TObject);
begin
A00pnlTransactionfinished_.SendToBack;
dmMCr_.cCR_.Connected := False;
Close;
end;
I "solved the problem" by deleting the button and putting
a new button that I gave the same name as the old one
and used the old code. And it works fine ?!
My question is how has this happened and how to prevent
it as it happened a couple of times.
jan welmers
aruba.
[I wish all members all the best and am thankfull to be able to find
so much instructive material on this site thanks to
all you wonderfull contributors and hope one day also
to be able to make contributions to the site]
------------------------ Yahoo! Groups Sponsor --------------------~-->
AIDS in India: A "lurking bomb." Click and help stop AIDS now.
http://us.click.yahoo.com/9QUssC/lzNLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/