Can I group certain conditions using CASE statements?

Status
Not open for further replies.

aeneas81

Junior Member level 1
Joined
Jun 14, 2004
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
198
Beginner's Questions

Hi all, is there anyway I can group certain condition together when using CASE statements?
such as

CASE input_vector IS
WHEN "001" AND "010" => blah blah..

The above command doesn't work, coz the compiler ANDed the 001 and 010 together, instead of treating them as seperate conditions.

Thanks for help!
 

Re: Beginner's Questions

try this style:

process
variable Code_of_Operation : INTEGER range 0 to 2;
constant Variable_1 : INTEGER := 0;

begin
case Code_of_Operation is
when Variable_1 | Variable_1 + 1 =>
Operation := 0;
when Variable_1 + 2 =>
Operation := 1;
end case;
end process;
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…