Информатика. Программирование в Delphi
185
'0'..'9',#8:;
',','.':
begin
key:=DecimalSeparator;
if pos(key,ComboBox1.Text)<>0 then
key:=#0;
end
else
key:=#0;
end;
end;
procedure TForm1.ComboBox2KeyPress (Sender: TObject; var Key: Char);
begin
case key of
'0'..'9',#8:;
',','.':
begin
key:=DecimalSeparator;
if pos(key,ComboBox1.Text)<>0 then
key:=#0;
end
else
key:=#0;
end;
end;
procedure TForm1.Button1Click (Sender: TObject);
const
gr=pi/180;
var
x,y,z:real;
begin
if ComboBox3.ItemIndex in [0,1,2,3] then
begin
if (ComboBox1.Text)='' then
exit;
end
else
if ((ComboBox1.Text)='') or (ComboBox2.Text='') then
exit;
case ComboBox1.ItemIndex of
0:x:=0;
1:x:=pi/6;