Raised This Month: $ Target: $400
 0% 

Ban all CTs in a loop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-16-2009 , 15:52   Re: Ban all CTs in a loop
Reply With Quote #1

To avoid the damn brackets xD and also if the code in the loop is big and I just want suddenly to add a check to the whole code, like if the user is alive or something

tell me one good reason why I shouldn't use return and continue instead of brackets and I'll understand
__________________
Hunter-Digital is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-16-2009 , 16:54   Re: Ban all CTs in a loop
Reply With Quote #2

Quote:
Originally Posted by Hunter-Digital View Post
To avoid the damn brackets xD and also if the code in the loop is big and I just want suddenly to add a check to the whole code, like if the user is alive or something

tell me one good reason why I shouldn't use return and continue instead of brackets and I'll understand
Is it big? I think you answered it yourself.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-16-2009 , 17:03   Re: Ban all CTs in a loop
Reply With Quote #3

If I want to do one action with that loop, then I use continue.
If I want to do 2 different actions that depend on something about the individual index of the loop, then I use if() and else[ if]().
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-16-2009 , 17:36   Re: Ban all CTs in a loop
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Is it big? I think you answered it yourself.
I wasn't talking about this code, I said IF my code inside the loop WOULD BE big...

Still, I like the code to be in a row... not too far off pushed to the right, if I do an if() with brackets on everything I get to have 5-10 open brackets (again, generaly speaking, not this code, this is small but I'm used to use continue and return, I also do this in php )

I use continue whenever I need to skip everything else... if I need to choose between two or more things I use if(), else if(), switch() etc...
__________________
Hunter-Digital is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode