TaFWeb Software
A UK Company
Error Correction
with TrainzObjectz
   
MAIN MENU
=================
Home Page

Downloads

Tutorials

KUID List

Search this Site

Other UK Content

TaFWeb Software Home Page

Text-only version of web site (suitable for page readers)



FastCounter by
LinkExchange

Error Correction with TrainzObjectz

Now that TRS2004 is a lot more particular about the config.txt files many of us will find that we need to correct errors in downloaded content. This tutorial aims to show you the sort of errors you are most likely to come across, and give hints on how to correct them.

Unmatched Quotation Marks

Unmatched Quotation Mark

You will be alerted to this type of error with the message shown above. On clicking "Yes", the configuration file will be loaded into TrainzObjectz internal editor as shown below.

Internal editor

The sections highlighted in blue show the text which occurs between successive quotation marks. Note that the highlighting starts immediately after the word username. It should end at the end of that line, but instead continues down until it get to the line which begins description. It is quite obvious that the author of the content did not intend the username to be "Example content category-region-0 UK category-era-0 1930s description". If you type a quotation mark at the end of the line which starts "username" then only the part which says "Example content" will remain highlighted, and this seems a much more likely username. The other highlighted sections also look a lot more reasonable! A related common error is to place a single quote ( ' ) at the end instead of a double quote ( " ). In this case the single quote should simply be replaced by a double quote.

Corrected file

Space Missing in Obsolete-Table Entry

Space Missing in Obsolete-Table Entry

This type of error can be corrected automatically by TrainzObjectz. Simply click the "Yes" button and TrainzObjectz will put the space where it is meant to be. Clicking "No to All" will stop TrainzObjectz asking you about any further errors of this type during the current session. Choosing "Ignore" is not advised as this will stop TrainzObjectz querying that error in that same file any more, but if you are sure that the error does not exist then you can choose this option.

Missing Closing Bracket

Bracket ( { and } ) are used in configuration files to mark the beginning and end of more complex tags. Each opening bracket should be matched with a later closing bracket. If one of the closing brackets is missing then you will see the message shown below:

Missing Closing Bracket

On clicking the "Yes" button TrainzObjectz will show the file in its internal editor:

Internal editor

You can see that TrainzObjectz has highlighted in red the sections between successive opening and closing brackets. It has also indented each section. The first set of brackets (starting with the line which begins kuid-table) is correct, but the second set (starting at obsolete-table) goes through to the end of the document without finding a closing bracket. In this case, the closing bracket needs to be placed in the blank line underneath 0 . Unfortunately TrainzObjectz has no way of knowing where the closing bracket should go, so here you are on your own! If in doubt, have a look at some other (correct) config.txt files and see whether you can find one which looks very similar. The position can be complicated even further when you have brackets inside brackets, like the example below:

Internal editor

In this case (and it is by far the most common one) it is the final closing bracket which is missing, and should be placed just above the line "username "Example content"".

Too Many Closing Brackets

Too many closing brackets

This is the opposite of the case quoted above - there are too many closing brackets rather than not enough (or, just to complicate things, it could be a case of not enough opening brackets). The editor shows the file like this:

Internal editor

Here again the indenting helps us. We can see that, above the "username" line there are two brackets right against the edge of the screen. The first one is correct, but the second one is unnecessary and should be deleted.

Other Errors

Of course there are many other possible errors in config.txt files, and unfortunately TrainzObjectz is not always able to detect them. Some others errors to look out for are:

  • Commas used instead of decimal points:
    1,2 instead of 1.2
  • Double quotes used inside double quotes:
    description "The locomotive has a length: 95'6" and was first introduced in..."
  • Bad spelling:
    compeny British Rail
  • Badly formed KUID numbers (TrainzObjectz will pick up and correct the main KUID if it is badly formed):
    enginespec <KUID -1:42004201>

    I hope this will help you to correct any errors you come across. This guide, of course, cannot be comprehensive, and some errors will require a knowledge of configuration files to be able to correct them, but nearly all of the errors I have come across have been quite simple to sort out. Remember, it pays to look at correct configuration files because in this way you will build up your knowledge and be able more easily to spot the ones that are wrong.


Other links you may find of interest:

TaFWeb Software
London, UK
E-mail:

This page URL: http://www.tafweb-trainz.co.uk/error_correction_old.html
Last major revision: 13 November 2003 at 02:06 Minor revisions: 13 November 2003 at 16:31
Site created with PageBuilder

Web page created by TaFWeb Design © 2008