JTraffic Screensaver

General Rules

The Timetable file is a text file that determines the composition of trains and their movements on the screen, as well as contains settings for the configuration of the program.

Each command in the Timetable must be in a single line of code.  This, however, can be difficult to read when programming so there are a few conventions you can observe which make reading and programming easier.

  • Lines which begin with a # (octothorp or "pound" sign) ; (semicolon) / (forward slash) or * (asterisk) are Comment Lines. They are skipped over by the program and can be used to make comments or notes about the program code.
  • Lines of code, especially more complex ones, often become very long and may be difficult to read.  To increase readability in the window, a single line of code may be "wrapped" by inserting a \ (backslash) where you want the code to wrap.  However, you cannot have any further characters on that line after the wrap point, not even spaces or TABs!  Having these will lead to errors when the code is processed.
  • TABs can be used to break up the text and increase readability without affecting the code itself.
  • The program code is not case-sensitive.

Several commands or parameter values have different codes but the same result or meaning.  This is simply because the codes are often abbreviations for words in different languages.  For example, I, J and Y all may have the same meaning as they represent the same word in three different languages (in this case Hungarian "Igen", German "Ja" and English "Yes.")  You may use the codes that you are most comfortable with.  

In the following description of the syntax the double equal sign ( ==) means " is defined as" and the double bar ( || ) means " or".

Bold signifies exactly the character or text which appears in bold.

Elements between the less than and greater than signs  ( < and >) are syntax elements defined by abstract rules.  At the moment, only parts of the syntax are described in this abstract form.

How does one interpret all this?  Here's a simple example:

<Simple> == <Digit> || <Simple> <Digit>

<Digit> == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9

This is the long way of describing a whole number.  A number is--no surprise--one of the numeric characters <Digit>.  The double bar indicates: choose only one.  Therefore, the number picked is 1 or 2 or 3 and so on.  And what does <Simple> mean?  The left-hand part says <Simple> == <Digit>, which means, a single digit number is defined by the statement.  The second half is: <Simple> == <Simple> <Digit>.  This means, if you have a sequence of symbols which match the rule <Simple>, then you can append a second <Digit> and still come up with <Simple>.  This recursive definition defines the entity <Simple> completely: it is a whole number; an integer.

The Syntax Checking of the Timetable File is not as exacting as a true compiler.  If you use the correct expressions as specified in the rules below, you should generate the described and desired behavior, even in future releases of the program.  

If you use an expression violating the rules listed here, you may get an error message.  These appear in the form of a message box, or in the form of a white square travelling in the place of the vehicle picture, with the error text written on it.  On the other hand, perhaps you will get some functional result.  For example, inputting a fractional number value in the place where only an integer number is expected can lead to error, but can also lead to the fraction being rounded to the next integer.  Therefore, you may get an error or not depending on context.  

Using special characters and certain specific "regular" characters (such as the period " ." or the dash " -") in picture names can cause errors or misinterpretation in some expressions or, perchance, you may get the result you desire.  However, it is better to avoid such constructs.  Perhaps the same expression will cause an error in the next program version, or invoke a new feature - with undesired results.  Therefore, it is strongly advised to use only standard English alphanumeric characters and the underscore character for picture and macro names.

The Configuration Window
Program Window
Stock List
Description Editor
Graphic Testpad
Timetable Editor
Timetable Syntax and Semanics
The timetable header
Sections, Groups, Lines, Scenes
Stock List File