Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
mose
Novice


Joined: 02 Dec 2010
Posts: 30

PostPosted: Mon Dec 13, 2010 6:45 pm   

More debugger information?
 
Is there a way to get more information from the debugger? I created a class, put some lines in the enable script and when I right clicked to execute the script, nothing happened. There were no error messages, and the debugger didn't show anything. Nada. I finally tracked down the problem to an extra character in the wrong place. In another situation, I got a message in the main window that the trigger had fired, but it didn't compile. That was it. There wasn't anything in the debugger window to indicate where the problem might have been. Again, I tracked it down to a missing character.

Is there a way for the debugger to show what line (and what character) is causing the problem? Is there a different way to do this? For example, is there a way to step through the code line by line and see the problem when it gets there? Is there something else I should be doing to get more information about compile errors? Thanks.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Dec 13, 2010 7:28 pm   
 
Pressing Ctrl-K in your script it will show you where CMUD thinks the error is.

I don't believe there is a way to step through the code in CMUD. You can also post the code here and we'll try to help you figure out what's happening. post them within [code] tags.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 13, 2010 10:37 pm   
 
As Tech mentioned, Ctrl-K is the way to find compile errors in a script. During script execution, CMUD has no idea about line numbers or anything else because it is executing compiled code. So there is no way for it to give a better error message during execution. In some cases if a script doesn't compile CMUD might even assume it's verbatim text to be sent to the MUD instead of a script to be executed. That's why it doesn't spam the screen with compile errors.

You can also use the File/Compatibility Report option in the Settings Editor to test *all* of your scripts to see if they compile. That's easier than using Ctrl-K one-by-one in each script.

For runtime errors, all you can do is add your own #DEBUG statements to your code. There isn't any way to single-step through your scripts (again, because CMUD is running compiled code and not running interpreted scripts like zMUD did).
Reply with quote
mose
Novice


Joined: 02 Dec 2010
Posts: 30

PostPosted: Wed Dec 15, 2010 1:56 pm   
 
OK, I will work with ctrl-K to track down pesky syntax problems. If you come across the opportunity, it would be very helpful if the compiler could print a simple message to the debugger window like 'compiler stopped at "#if (somevar = @othervar)"'. That would provide a clue where in the code to look for issues. Even more compiler hints would be welcome. :-)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Dec 15, 2010 5:29 pm   
 
The Compatibility Report should do that.

Again, scripts cannot necessarily print a message to the Script Debugger because Windows only allows the main thread to print to the user interface and often your script (or the compiler) is running in a separate thread. If it was easy to do this, I would have already implemented it.

The Compatibility Report loops through all of your scripts and tries to compile each one and prints any compile error to the Compatibility Report window.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net