Jump to content
Sign in to follow this  
lordprimate

Undifined variables

Recommended Posts

Hello all, Since a few patches ago to the Dev build we have got the undefined variables pooping up in the script error dialog. I have been looking and looking but have NO idea how to fix this.. Can someone help me out here..???

I read that it was something to do with the order of execution of code.. and that, "it was a bug and would be fixed".

I then read that it was fixed, yet I sill get the errors. So There is something else we have to do to make sure the variables are defined.. I dont know what it is nor can I find a thread that has the info i need to enlighten me... Can someone that knows the issue post up here how to resolve the issue.. In Ley_monkey terms please..

Share this post


Link to post
Share on other sites

I had the same error in my code. To fix it you have to make sure that the variable that throws the error must be properly initiliazed. To debug it is quite simple. Just look from the code where the error is pointing at and trace backwards and see if you forgot or missed the initilialization of the variable. It could also be reading a value at index X where the array is only of length X (index X means the array should have at least X+1 elements).

I tend to arrange my code in a predictable sequence so that it is easy to synchronize and in the event of script error, easy to trace. A unpredictable sequence of script running could easily result in global variable being not initialized properly.

Edited by 2fast

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×