Appendix 6. How to fight errors and read someone else's code

To begin with, study exception message carefully. It contains name of file and number of line where error cropped up. You should be very attentive when coding and turn to reference from time to time. You should also always remember that Parser operates in object model: never forget what class of objects you use. Certain methods return an object of different class!

For example, certain methods of class date return object of class table. If you attempt to apply methods of class date to such an object, it will cause error. You can NOT apply method of one class to an object of different class. This stage, however, will soon be over. Errors of another type are those, which lie in the code's logic. This kind of problem is not that easy to solve and demands more patience. We insist that you give correct names to variables, methods, and classes and comment your code.

If you still are not able to realize what the mistake is-turn to the reference. "If all else fails, try reading the instructions…" The last stage in trying to fight an error is when you are on the verge of madness: you read your prayers or cast spells, but your code does not work anyway. In this case, you should turn to those who know Parser a little better than you: post your question to forum dedicated to Parser, and they will try to help you. You are not alone! Good luck!


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 01.04.2004