I'm using delphi to run the following code:
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';
I need to do the exact code but using case
, I am trying but didn't find any content that explains how to do it:
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;
I've tried to search for questions about case as well, but I guess I didn't find the correct way to find for this answer as well.