Re: Need some help with my script
no problem. In subroutines a return value is not necessary, but you can include one. It doesn't follow the same structure as high level language though, notice how mine is inside an if statement, so it could in fact never execute, leaving my subroutine without a return value (not allowed in many languages). That was the issue, on certain cases the variables assigned to the subroutine value returned ended up either equaling nothing or whatever may be equivalent to void. So my variables would equal the correct value, but following another execution of the subroutine given a case where the return statement wasn't executed, they were overridden. I hope that makes sense....and is understandable. I just threw in a "error check" if statement to correct the problem.
|