Let me go ahead and give another great debuging idea then lol.

If your dealing with alot of strings and or variables in a single function or even alot of different functions, make a panel show all the values of the variables and strings your dealing with (make sure the panel displayed the updated results) then add a while loop after every major part of your script that waits until a button is press (ex. space bar) Before it continues while displaying all the strings and variables on the screen along with a number to indicate what line your up to (this can be done by simply having a variable named lineNumVar and pasting lineNumVar += 1; to the start of every line. If you do major jumps simply adjust lineNumVar to the appropriate line before continueing).

Now go through your code and press the space bar until you see something you didn't expect. The best way to do this is by printing out the peace of code and have it right next to you so you can quickly look to see if everything is checking out.

Start general then work your way down for the best results and to save time.

If a function calls 5 other functions update the strings and vars only before and after every function is called. Then you'll know which function is screwing up. Then go to that function and do the same thing.

This method is very thorough but very timw consuming. However I have yet to not find the bug using this meathod.

edit: Oh and one way to prevent bugs is actually simple. If your a fast typer and your copying a short command or sets of commands, you might want to just type it out. The reason for this is because if your copying and pasting but need to make a small change, you might forget to do so and create a tough problem to find later on. This might sound crazy and stupid, but after a while... say 3 hours of scripting non-stop, the brain starts to skip up on you. Believe me, all this is from personal experience. I hope it's helped a few people.




Last edited by PrenceOfDarkness; 01/15/07 09:36.

"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.