returning values
What's the difference between
Code:
Code:
and Code:
Code:
|
if you just use return it would be the same as using return PLUGIN_CONTINUE
plain continue is used to skip the rest of the code in a particular iteration of a loop and go to the next. There is more in the wiki |
Also search. There are a good explanation of return PLUGIN_*'s (by PM i think).
|
Quote:
return; alone suggests that the function has no return value - it only suggests that you want to stop execution of the function. The fact that this acutally returns a zero (which, by chance, is what PLUGIN_CONTINUE is defined to) when used in a public function is an implementation detail. Basically: If a function has a return value (for your own (stock) function you can decide yourself, for public functions the host aplication (=AMXX) decides*), you should always use Code:
If the function doesn't have a return value, it's not neccessary (and not encouraged) to put a single return at the end; and if you want to exit the function immediately, use Code:
*) technically, all public functions have return a value to the host application. However, the host application can decide to ignore it. In that case the programmer should treat that function as a function without a return value - unless he wants to call it from his own code and return something; that's pretty unlikely though ;o |
Ohayo PM-san! :D
continue and break are used to cycle in loops; break jumps out of the loop while continue jumps to the next state in the loop cycle! hope that is helpful to you lock-san! :D |
| All times are GMT -4. The time now is 05:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.