[20 Dec 2009] Q of Function (defining value later in code, affects it earlier?)
Posted: Sat Jun 13, 2020 5:32 pm
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 20 Dec 2009 05:31:27 -0000
I just spent close to hour bug hunting until i finally hunted reason down and it surely was about last thing anymore to try.
code example:
When i enter in my program to that function, value of throwpower is something between 1-100.
Strange thing is, that if i leave this program this way, it refuses to work right, but stops my snowball flying rightaway (Speed = 0).
But if i delete line 3 (throwpower=0) out of program, then it works fine.
So my question is:
How can it be, that affecting some value at later point in Function, affects that value at earlier point?
Is this a bug, have i missed something, or dont i understand the innerworks of hollywood at all?
I just spent close to hour bug hunting until i finally hunted reason down and it surely was about last thing anymore to try.
code example:
Code: Select all
1: Function p_snowballthrowing
2: Speed = throwpower*1
3: throwpower=0
4: EndFunction
Strange thing is, that if i leave this program this way, it refuses to work right, but stops my snowball flying rightaway (Speed = 0).
But if i delete line 3 (throwpower=0) out of program, then it works fine.
So my question is:
How can it be, that affecting some value at later point in Function, affects that value at earlier point?
Is this a bug, have i missed something, or dont i understand the innerworks of hollywood at all?