Jun 15, 2004 #1 A 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!
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!
Jun 15, 2004 #2 Y yerics Member level 1 Joined Sep 25, 2003 Messages 40 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Location Beijing,China Activity points 331 Beginner's Questions CASE input_vector IS WHEN "001" |"010" => blah blah.. OK!
Jun 15, 2004 #3 H Husoo Newbie level 6 Joined May 25, 2004 Messages 12 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 156 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;
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;