Hello I am new to Pascal language, but my company is asking that I learn.
Right now I would like to create a window with three radio buttons that we can select based on different materials (i.e. Copper, steel, graphite) and the output would result in a calculation based on a yield from another software.
I am sure this is a little confusing so for example, we create a steel product in our in house software and it outputs a yield of .982 sheets. Then we have to take a calculator and by hand calculate the actual yield (yield from in house program/12/20/100*250). But if they use another material (copper) it is a different calculation (yield from in house program/9/20/62.5*250).
Right now I have two text fields: one that has the in house number and one that I want to have my calculated number. With the Procedure below, I was just trying to test with a straight formula if I could get a real number to be the result .(982 steel yield would result in .0102 actual yield) and then work on getting the radio buttons to work.
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
VAR I: Integer;
Itotal: Real;
begin
I:=StrtoInt(Edit1.TEXT);
Itotal:=Round(I/12/20/100*250);
edit2.TEXT:=StrtoFloat(Itotal);
end;
end.
Any help you can provide would be greatly appreciated.
Thank you,
Daniel