more G-Labs products

Author Topic: Differentiate between Trigger and Run code in Scripting  (Read 1081 times)

May 28, 2014, 06:04:25 PM
Read 1081 times

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I was copying the code from one script to a new one manually yesterday.  I didn't want to spend the effort to export and import, so I just opened a new window and proceeded.  After copying and modifying the working code, I ran into some cryptic errors that took some time to understand. 

In short, I copied the run code to the trigger window and the trigger code to the run window.  This is a simple fix, but it took half an hour to figure out what the error was telling me.  I don't know that this is an issue anyone else would come across, but it was mostly confusing because it gave the line number for the error when I was on the run code window and it was actually referring to the trigger code line number.

My request is for there to be either a different window color for the trigger versus run windows and/or a better error message to let you know that the issue is in the trigger/run code.  I think a different color background would have prevented me from making the silly copy mistake, but having a debug message that makes a little more sense to point you to the correct location in code would also be helpful.

May 29, 2014, 12:40:11 AM
Reply #1

bradvoy

  • ***
  • Information
  • Full Member
  • Posts: 50
I've made this same mistake too and was baffled by it for quite a while.  The error was saying there was something wrong with line 7 but the message didn't seem to correspond at all to what was on line 7 until I finally figured out that it was referring to line 7 on the trigger code.  I agree that a different color would be a good way to differentiate the 2 sources of errors.