switch()
I am fuzzy on what is needed for a switch to work properly so would this:
Code:
Code:
|
Re: switch()
Yes, it is the same
|
Re: switch()
Yep that is right.
With the cases you can also do ranges: Code:
|
Re: switch()
ok ty
|
Re: switch()
it isnt the same
Fact1: in your case example you compare 0 - 3 and in your if example 1-4. It would be the same if you use the same values. Fact2: the switch/case statement is a lot faster then if/elseiif Fact3: it looks better in the file Fact4: you cant compare strings with the switch/case statement |
Re: switch()
#5: You can use only constant values for cases
|
Re: switch()
ok thanks green/ven
|
| All times are GMT -4. The time now is 22:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.