parenthesis error script - 04/09/03 03:20 PM
Code:
alias isloaded { var %d 1,%script $1,%result while (%d <= $script(0)) { if ($nopath($script(%d)) == %script) { %result = 1 } inc %d } return $iif(%result,%result,0) } alias getpath { var %i 1,%script $1,%result while (%i <= $script(0)) { if ($nopath($script(%i)) == %script) { %result = $+(",$script(%i),") } inc %i } return $iif(%result,%result,0) } alias error { var %g 1 var %file $1 var %file.path $getpath(%file) var %error 0 if (!$isloaded(%file)) { return $1 Is Not Loaded } while (%g <= $lines(%file.path)) { if ($+(*,$chr(123),*) iswm $read(%file.path,%g)) { inc %error $count($read(%file.path,%g),$chr(123)) } if ($+(*,$chr(125),*) iswm $read(%file.path,%g)) { dec %error $count($read(%file.path,%g),$chr(125)) } inc %g } return %error }
that script is supposed to increase a variable called "%error" when a { is found, then decrease it when a } is found, i used it on a file with NO errors, it returned "-13", anyone have any ideas how the hell it returned this?