What value does a script return by default?

K

Kululu17

Guest
Hi Guys,

I couldn't find this in the manual anywhere, but if you attempt to get a value from a script, and it doesn't explicitly return one, what value is used? For example:

***Main code***
Quadrant = 10;
Quadrant = script_execute(My_Script);

*** Within My_Script ***

if XYZ == true {return 5}

****

So if XYZ is true, then it resets the value Quadrant to 5. But what if XYZ is false? Is there a "default" if you don't specifically return a value from the script? Or does it give inconsistent results?

Thanks.
 
H

Homunculus

Guest
Can't you just add a default return value yourself? Seems a better solution to me...
 
K

Kululu17

Guest
Thanks! I did see that it was zero in one case, but was not sure if it was always that, of if it was one of those things that can give inconsistent answers.
 

TheouAegis

Member
Oh, well I did just test with an actual return. So try doing a script that has absolutely no returns at all in it. Just in case the compiler detect if there are any returns. I don't know, maybe if there are no returns at all in the script then it will give an undefined period but I'm guessing it will still be zero.
 
Top