tags:

views:

75

answers:

3

how many braches can i create using if statement?? is it limited??

A: 

No, it is not limited except by the storage capacity on your development system.

Alexander Gessler
I think that strongly depends on the compiler in question ...
Joey
He did not say that he intends to compile his code, actually. I can put as many branches in my files as I want, the only limiting factor will be the storage capacity plus file system constraints :-)
Alexander Gessler
+1  A: 

An IF statement always has exactly two branches: one where the condition is FALSE and one where the condition is TRUE. A branching construct that has more than two branches is usually called CASE or SWITCH. In Pascal, it's CASE.

Jörg W Mittag
Of course, you can always nest your control structures, limited only by your ability to copy-and-paste, and the compilers memory limits.
Craig Trader
A: 

Always think towards a State/Strategy pattern before making a ton of branches on logic. Not sure your language of choice so I cant really help with concrete implementation, but you should be able to refactor any switch case or if comparable into a Key hooked to the correct value, and pull out the object/method/variable needed based on your key.

Gnostus
It's tagged `pascal` – does that tell you anything about the language in question? :-)
Joey
:P, an early morning it was today.things to make you go... derp.
Gnostus