Home All Groups Group Topic Archive Search About

Too many case conditions?

Author
8 Jan 2006 2:48 PM
Showjumper
I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding
on what node is clicked, a user control is loaded and displayed. I  am
loading the user control using a select case. So far there about 10 cases.
Is that too many? Is there such  a thing as too many cases?

Thanks
Ashok

Author
8 Jan 2006 3:00 PM
Scott M.
The more cases, the greater the possibility of a slower response time for
this case statement, but is there an actual limit to the amount of cases you
can have?  Not, that I'm aware of.  10 is certainly not too many.



Show quoteHide quote
"Showjumper" <dfgkjhdf> wrote in message
news:%23JDDpKGFGHA.2708@TK2MSFTNGP11.phx.gbl...
>
> I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding
> on what node is clicked, a user control is loaded and displayed. I  am
> loading the user control using a select case. So far there about 10 cases.
> Is that too many? Is there such  a thing as too many cases?
>
> Thanks
> Ashok
>
>
Author
8 Jan 2006 4:03 PM
m.posseth
Note that you should set the case that is believed to take place the most
as the first case
also a good aproach might be to use at a certain point nested cases when a
situation takes place after another should have been taken place

by the way a select case is almost always faster as nested if then else
statements  if you use the above described aproach it is always the fastest
aproach  :-)


regards

Michel Posseth [MCP]


Show quoteHide quote
"Showjumper" <dfgkjhdf> wrote in message
news:%23JDDpKGFGHA.2708@TK2MSFTNGP11.phx.gbl...
>
> I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding
> on what node is clicked, a user control is loaded and displayed. I  am
> loading the user control using a select case. So far there about 10 cases.
> Is that too many? Is there such  a thing as too many cases?
>
> Thanks
> Ashok
>
>
Author
9 Jan 2006 4:29 PM
Carlos J. Quintero [VB MVP]
Hi Ashok,

No, 10 cases are not too many, and as long as they don´t contain expressions
that must be evaluated they are quite fast.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio 2005, Visual Studio .NET,
VB6, VB5 and VBA
You can code, design and document much faster in VB.NET, C#, C++ or VJ#
Free resources for add-in developers:
http://www.mztools.com

Show quoteHide quote
"Showjumper" <dfgkjhdf> escribió en el mensaje
news:%23JDDpKGFGHA.2708@TK2MSFTNGP11.phx.gbl...
>
> I am working on a CF 2.0 PPC app that utilizes a treview control. Depeding
> on what node is clicked, a user control is loaded and displayed. I  am
> loading the user control using a select case. So far there about 10 cases.
> Is that too many? Is there such  a thing as too many cases?
>
> Thanks
> Ashok
>
>