IDEA Script debugging strategies

2 posts / 0 new
Last post
Joined: 03/02/2016 - 12:12
IDEA Script debugging strategies

Awesome stuff here.
I am interested in strategies for debugging.  After a breakpoint, I can step through code, and there is visibility of some variables.  However, it is difficult to evaluate functions on the fly, and that is a problem it they cause an error.  Also there is some odd behaviour around dialog forms, where it seems particularly difficult to pin-point the root cause...  This must be a frequent difficulty for the more creative coders and I wondered how people work around it.  I am used to the VBA IDE and being able to see and test stuff in real time. 
One strategy that occurred to me is to have a stock piece of interactive safe code, like a "hello world" message that could be moved during the step through, and possibly used to evaluate functions before they impact the main programme.
Any ideas will be tried most gratefully.

Brian Element's picture
Brian Element
Joined: 07/11/2012 - 19:57

Hi Edward,

Yes, unfortunately the editor has seen better days and there is limited functionality when looking for errors.

I seem to use msgbox to verify that the code is working properly, this is usually after the editor has given me an error, I place message boxes to find where the code is stopping and check out what a variable is holding, never used the built in step through that much.

Yes dialogs, if they have an error, they can drive you nuts.  I have now learned that if I have an error that only shows up sometimes and can move around in the code then it is probably in the dialog box.  An error can be as simple as having two textboxs with the same ID.

There are also other problems with the editor.  Such as recently I found out that if you define an array and you use the word function in a comment next to the array the script editor seems to think it is a new function so will not allow you to redim the array.  That took some head scratching and help from IDEA to figure out this error.

There are also the statements on error goto ... but I only use that when the script is in production as it won't show where the error might be in the code.

 Unfortunately there are not a great number of options available but I would also love to hear about other strategies that people are using.