|
From: Santiago P. C. <San...@yd...> - 2002-07-02 10:44:19
|
Hi Mr. Cristian,
I'm not sure if this is the best solution for your 'problem', but.. what
about this code?
switch (x){
case 3 :
code3;
// NO break!!!
case 1 :
code_1;
break;
case 4 :
code 4;
// NO break!!!
case 2 :
code_2;
break ;
default:
default_code;
break;
}
Just my 2 cents,
Santy
BTW, using inline functions is at least as good solution as this or even
better, thanx Ioannis for pointing it out!! ;o)
-----Original Message-----
From: Ioannis Vranos [mailto:no...@ho...]
Sent: Tuesday, July 02, 2002 12:25 PM
To: dev...@li...
Subject: RE: [Dev-C++] C#
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Teodorescu
Cristian
Sent: Tuesday, July 02, 2002 10:32 AM
To: dev...@li...
Subject: Re: [Dev-C++] C#
Bad and good
Bad becuse they called goto.
Good beacuse it help you to define a way a good one in a switch sometimes i
have to write smth like
switch (x){
case 1 : code_1 ;break
case 2 : code_2 ;break
case 3 : code3+code 1:break
case 4 : code 4+code 2:break
default : break;
};
so in C# :
switch (x){
case 1 :code_1;
case 2 : code_2;
case 3 : code 3 goto 1;
case 4 : code_4 goto 2;
};
more simple :-)
Perhaps a bad design issue? My first solution to this is to make small
inlining functions for code1 & code2.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
--------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and intended solely
for the use of the individual or entity to whom they are addressed. No confidentiality
or privilege is waived or lost by any wrong transmission.
If you have received this message in error, please immediately destroy it and kindly
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. Opinions, conclusions and
other information in this message that do not relate to the official business of
Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given nor endorsed by it.
--------------------------------------------------------------------------------------
|