(07-20-2011, 06:23 PM)Kyle Wrote: (07-20-2011, 06:14 PM)xiphirx Wrote: Sorry, this is not advanced scripting, you're still at the beginner level.
It would help if you knew C/++ beforehand, but it looks like you're learning as you go.
The first two examples that Kyle posted in his first post are incorrect as they do not have the same effect. Also, you do not need the return statement really, its a void function to begin with.
Excuse you, I know C++ already and I know they don't have the same effect. Of course I know that the second one has the effect of, in this case, that if the first "if" statement is incorrect, then the second one works nevertheless. I just didn't point out that in the second case that it could be applied to a statement that includes more than 2 values. Also, please try to be nice, I know that it's not advanced, I just want him to feel good and confident to actually reach that level and not sink back and become careless by no motivation. :/
About that "return" statement, it could be needed if the "if" statement is added on with the factor of having something in the case if none of the "if" statements are true.
"Excuse you", I was talking to the OP in regards to knowing C++. The first two examples wont accomplish what hes trying to do, have two statements bounded by and be true before executing actions. You should have only shown the third code snippet.
I fail to see where I'm being harsh. I'm just being realistic. I would rather not bullshit the OP into thinking hes doing really high level stuff and get his hopes down when he actually does do advanced stuff. Motivation is his issue, not yours. Even if he had alot of C++ knowledge, it wouldn't matter since motivation is a independent feeling.
The return statement has no point in the function other than cutting it off early, which will happen when you reach the end anyway.