У меня на форме 5 радиогруп для перевода величин в систему Си(Длинна, Вес, Давление, Енерогия и т.п.) каждая точка определяет значение b:= мне нужно, чтобы активной была тольо одна из 5-ти радиогруп, а то так у меня все значения b перемножаються и на это "B" умнажаеться заданое число | Код | unit Unit4;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, Menus, ExtCtrls;
type TForm4 = class(TForm) BitBtn1: TBitBtn; Edit1: TEdit; Edit2: TEdit; BitBtn3: TBitBtn; RadioGroup2: TRadioGroup; RadioGroup3: TRadioGroup; RadioGroup4: TRadioGroup; RadioGroup5: TRadioGroup; RadioGroup8: TRadioGroup; procedure BitBtn1Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form4: TForm4; s:string; a,b,c:real; cod:integer; implementation
uses Unit1, Unit2, Unit3;
{$R *.dfm}
procedure TForm4.BitBtn1Click(Sender: TObject); begin Form1.hide; Form2.show; Form3.hide; Form4.hide; end;
procedure TForm4.BitBtn3Click(Sender: TObject); begin if RadioGroup2.ItemIndex=0 then b:=0.0000000001;
if RadioGroup2.ItemIndex=1 then b:=0.000000001;
if RadioGroup2.ItemIndex=2 then b:=0.000001;
if RadioGroup2.ItemIndex=3 then b:=0.001;
if RadioGroup2.ItemIndex=4 then b:=0.01;
if RadioGroup2.ItemIndex=5 then b:=0.1;
if RadioGroup2.ItemIndex=6 then b:=1000;
if RadioGroup4.ItemIndex=0 then b:=60;
if RadioGroup4.ItemIndex=1 then b:=3600;
if RadioGroup4.ItemIndex=2 then b:=86400;
if RadioGroup4.ItemIndex=3 then b:=604800;
if RadioGroup4.ItemIndex=4 then b:=2678400;
if RadioGroup4.ItemIndex=5 then b:=31536000;
if RadioGroup4.ItemIndex=6 then b:=31622400;
if RadioGroup4.ItemIndex=7 then b:=31557600000;
if RadioGroup8.ItemIndex=0 then b:=100000;
if RadioGroup8.ItemIndex=1 then b:=133.322;
if RadioGroup8.ItemIndex=2 then b:=98066.5;
if RadioGroup8.ItemIndex=3 then b:=101325;
if RadioGroup8.ItemIndex=4 then b:=133.322;
if RadioGroup3.ItemIndex=0 then b:=0.0002;
if RadioGroup3.ItemIndex=1 then b:=0.001;
if RadioGroup3.ItemIndex=2 then b:=100;
if RadioGroup3.ItemIndex=3 then b:=1000;
if RadioGroup5.ItemIndex=0 then b:=1000;
if RadioGroup5.ItemIndex=1 then b:=1000000;
val(Edit1.Text,a,cod); c:=a*b; str(c:7:12,s); Edit2.Text:=s; end;
end.
|
P.S. надеюсь я на понятном языке обьяснил? |