1 (edited by reberkurdi80 2016-02-06 14:39:16)

Topic: please help me any one know make code for this example...

I want whene i add number get  amount automatically after discount.....like
whene i add 100$ at 200$ automatically multiplication 15%
whene i add 200$ at 300$ automatically multiplication 20%
and whene i add 300$ at 400$ automatically multiplication  25%...

like that code  i think:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin

    Calculate
    if Edit1:=integer :=100 at 200 then
    100 at 200  * 15/100
    if Edit1:=integer:=200 at 300 then
    200 at 300 * 20 /100
   if Edit1:=integer:=200 at 300 then
    300 at 400 *25/100


end;

begin

Post's attachments

Attachment icon discount.zip 332.3 kb, 433 downloads since 2016-02-04 

Re: please help me any one know make code for this example...

Script for button1

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    discount: integer;
begin
    discount := 0;

    if (Form1.Edit1.Value >= 100) and (Form1.Edit1.Value < 200) then discount := 15
    else if (Form1.Edit1.Value >= 200) and (Form1.Edit1.Value < 300) then discount := 20
    else if (Form1.Edit1.Value >= 300) and (Form1.Edit1.Value < 400) then discount := 25;

    Form1.Edit2.Value := Form1.Edit1.Value - (Form1.Edit1.Value * discount/100);
end;
Dmitry.

Re: please help me any one know make code for this example...

Thank you Mr Dimitry...