Suppose there is a normal case
case a of 1 : ShowMessage('a=1'); 2 : ShowMessage('a=2'); 3 : ShowMessage('a=3'); 4 : ShowMessage('a=4'); else ShowMessage('no'); end; Is it possible to somehow implement this design:
case a of 1 : ShowMessage('a=1'); b:=10; 2 : ShowMessage('a=2'); b:=20; 3 : ShowMessage('a=3'); b:=30; 4 : ShowMessage('a=4'); b:=40; else ShowMessage('no'); end; Here is something similar, since after the fulfillment of the condition a:=1; it is necessary to assign a value to the variable b .
PS Or in what way can you solve the situation here without translating case into if ?
begin..end. After the colon, putbegin, then your code, thenend;(with semicolon) - kami