Форум по Delphi программированию

Delphi Sources



Вернуться   Форум по Delphi программированию > Все о Delphi > [ "Начинающим" ]
Ник
Пароль
Регистрация <<         Правила форума         >> FAQ Пользователи Календарь Поиск Сообщения за сегодня Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
  #1  
Старый 29.04.2011, 20:59
crazypiters crazypiters вне форума
Прохожий
 
Регистрация: 26.04.2011
Сообщения: 4
Репутация: 10
По умолчанию Как написать короче и оптимальнее

А можно ли сократить данный код?

Код:
procedure TForm2.RadioGroup7Click(Sender: TObject);
begin
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=5) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=0) and (RadioGroup6.ItemIndex=4) and (RadioGroup7.ItemIndex=3) then a:=2.8;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=5) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=0) and (RadioGroup6.ItemIndex=7) and (RadioGroup7.ItemIndex=3) then a:=3.7;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=5) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=2) and (RadioGroup6.ItemIndex=4) and (RadioGroup7.ItemIndex=3) then a:=3.3;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=5) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=2) and (RadioGroup6.ItemIndex=7) and (RadioGroup7.ItemIndex=3) then a:=4.3;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=5) and (RadioGroup4.ItemIndex=1) and (RadioGroup5.ItemIndex=0) and (RadioGroup6.ItemIndex=5) and (RadioGroup7.ItemIndex=0) then a:=20.7;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=0) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=1) and (RadioGroup6.ItemIndex=4) and (RadioGroup7.ItemIndex=3) then a:=1;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=0) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=2) and (RadioGroup6.ItemIndex=4) and (RadioGroup7.ItemIndex=3) then a:=0.7;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=6) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=1) and (RadioGroup6.ItemIndex=7) and (RadioGroup7.ItemIndex=3) then a:=5.4;
if (RadioGroup1.ItemIndex=0)  and (RadioGroup2.ItemIndex=6) and (RadioGroup4.ItemIndex=0) and (RadioGroup5.ItemIndex=2) and (RadioGroup6.ItemIndex=7) and (RadioGroup7.ItemIndex=3) then a:=3.8;
end;
Ответить с цитированием
 


Delphi Sources

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB-коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход


Часовой пояс GMT +3, время: 23:42.


 

Сайт

Форум

FAQ

Соглашения

Прочее

 

Copyright © Форум "Delphi Sources" by BrokenByte Software, 2004-2025