【发布时间】:2020-07-29 18:40:10
【问题描述】:
我正在使用delphi运行以下代码:
if (number> 8) and (number< 10) then
message:= 'first option'
else if (number> 11) and (number< 17) then
message:= 'second option'
else if (number> 18) then
message:= 'third option';
我需要做确切的代码,但使用case,我正在尝试但没有找到任何解释如何做的内容:
case idade of
(case > 8 and case< 10) : message:= 'first option';
(case > 11 and case< 17) : message:= 'second option';
(case > 18) : message:= 'third option';
end;
我也尝试搜索有关案例的问题,但我想我也没有找到找到此答案的正确方法。
【问题讨论】: