MGAlex Цитата: По-моему, Вы с логикой вообще не дружите, а другим пишите, что учиться надо.
Пишите по существу. Вы пишете чтобы главное программа работала, а какой дереволазный код после Вас - хоть потоп - без разницы. Я Вас так понял. Дружите со своей дереволазной логикой дальше. В моей логике написание внятного кода важнее желаний очередного директора. Стоп флуд.
Цитата: +1 Пишите как считаете нужным
Да пишите
if value=true then
Если будет работать с багами, то надо писать в Квелити-Централ статью.
Добавлено: Просто красивый безобидный пример того, что не важно как написано, главно чтобы работало.
[more=Незнание Action.GroupIndex]
Код: procedure TfmMain.RefreshFilterActionsChecked(TheState: boolean; TheAction:
TAction);
var
Act1, Act2, Act3, Act4, Act5, Act6, Act7, Act8, Act9: TAction;
begin
if TheAction = actFilterByName then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByPrice then
begin
Act1 := actFilterByName;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByEan13 then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByName;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByBarcode then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByName;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else
if TheAction = actFilterByIdPrep then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByName;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByCode1 then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByName;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByCode2 then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByName;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByCode3 then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByName;
Act8 := actFilterByRemPrep;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByRemPrep then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByName;
Act9 := actFilterByCode123;
end
else if TheAction = actFilterByCode123 then
begin
Act1 := actFilterByPrice;
Act2 := actFilterByEan13;
Act3 := actFilterByBarcode;
Act4 := actFilterByIdPrep;
Act5 := actFilterByCode1;
Act6 := actFilterByCode2;
Act7 := actFilterByCode3;
Act8 := actFilterByRemPrep;
Act9 := actFilterByName;
end
else
exit;
TheAction.Checked := TheState;
Act1.Checked := Act1.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act2.Checked := Act2.Checked and (not TheAction.Checked) and (not Act1.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act3.Checked := Act3.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act1.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act4.Checked := Act4.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act1.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act5.Checked := Act5.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act1.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act6.Checked := Act6.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act1.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act7.Checked := Act7.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act1.Checked) and (not Act8.Checked) and (not
Act9.Checked);
Act8.Checked := Act8.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act1.Checked) and (not
Act9.Checked);
Act9.Checked := Act9.Checked and (not TheAction.Checked) and (not Act2.Checked)
and (not Act3.Checked) and (not Act4.Checked) and (not Act5.Checked) and (not
Act6.Checked) and (not Act7.Checked) and (not Act8.Checked) and (not
Act1.Checked);
end;