Load the file syntaxedit.bet.
Compile ![[505 bytes 32x18 PNG] [505 bytes 32x18 PNG]](images/compbtn-small.png) and run
 and run ![[637 bytes 32x18 PNG] [637 bytes 32x18 PNG]](images/runbtn-small.png) the program. It contains a 'Reference is none'-error.
 the program. It contains a 'Reference is none'-error.
Click the Debug button ![[569 bytes 32x18 PNG] [569 bytes 32x18 PNG]](images/dbgbtn-small.png) in the toolbar or right click in the code and choose 'Compile/Run->Debug syntaxedit'. Now a debugging window pops up.
 in the toolbar or right click in the code and choose 'Compile/Run->Debug syntaxedit'. Now a debugging window pops up.
'kg'->value, which should be 'kg'->value[]). Close the debugging window, correct the error and run the program again.
It is that easy to find and correct errors like 'Reference is none'!
 'The car is:'->putline. Mark this line and right click. Choose 'Set Break' and mark something else (anything).
Click 'Go' in the debugging window. Now the program runs for a little while and then stops at the break point.
Click the Object button in the debugging window. This displays the active object, i.e. the object whose do-part is currently being executed. Here, the active object is of course the entire program.
You can see that the object has a component called  aPerson which is an instance of the program.Person pattern. But we already knew that. Now double click that line. Double click Name, and double click T. You can see that the person is Santa Claus. 
In this manner the object structure can be observed at runtime. Sometimes this is preferable to inserting debug-printlines.
Now click the break point <<1>>, then right click and choose 'Erase Break'. Choose 'Rerun' either from the right click menu or the new window. Now the program is ready to start over.
| Mjolner Tool Workshop | © 2001-2002 Mjølner Informatics | [Modified: Wednesday September 12th 2001 at 17:10]
 |