Thanks for this ivanrep if i dont need to spread
|
|

My Project: [Only registered and activated users can see links. ]
Ok I'm going to explain how to use switch statement.
Switch statement will replace all the annoying if statements.
The method without switch statement would look like
Now we can switch it and shorten that method toCode:public void Something() { if(Other == 1) MakeThing1(); else if(Other == 2) MakeThing2(); }
Thanks, hope it helped..Code:public void Something() { switch(Other) case 1: MakeThing1(); break; case 2: MakeThing2(); break; }
This is simple but effective..

Thanks for this ivanrep if i dont need to spread


nice rep + thanks for the link you gave me btw"

Well its for begginers
/stickyCorey + Ivan
I'm interested how you are writing cases without a break; statement, is this entire tutorial in purpose to show how your code will fail?
l2codeconvention.
holy ****, you explained in like too words good job!!!
| « Orb charge/Battlestaff Making | Command, Shop, interface by quest line, skill icons, etc » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |