25
6.2.4
Creating a PGN file
A file where multiple games can be stored and handled as in Section 6.2.3 can be created as follows:
• Open a blank document or text file.
• Save the file in Plain Text (*.txt) format.
• Change the ‘txt’ suffix to ‘pgn’.
Each game copied into the PGN file must be preceded by one or more ‘headers’. A header is enclosed in
square brackets and consists of a label followed by a string in double quotation marks.
The PGN tool requires each game to have at least
one
header with any of these three labels:
• Event
• White
• Black
A template for the ‘Event’ header is automatically supplied by the PGN Tool when a game is acquired from
The King. The string in quotation marks can be edited in the PGN Tool window, e.g.:
[Event "25-minute Rapid game"]
Then when the game is stored in the PGN file, the drop-down menu will display the string as an identification
for this game:
The fields denoted here by ‘???’ and ‘()’ are available to be filled by data from headers labelled ‘White’, ‘Black’
and ‘Result’. Other standard headers that can supply data for the drop-down menu are ‘Site’, ‘Date’ and
‘Round’. For example, you could equip a game with this set of headers:
[Event "Rapid chess match"]
[Site "Hastings, England"]
[Date "2018.07.17"]
[Round "2"]
[White "User"]
[Black "The King"]
[Result "1/2-1/2"]
Then the menu would identify the game like this:
Note:
To ensure correct formating (with quotation marks in the requisite style), the game data is more
conveniently edited in the PGN Tool window than in the PGN file itself.
6.2.5
Saving a game from a ‘set up’ position
If a game acquired from The King begins from a ‘set up’ position (see Section 5.12), the PGN Tool records that
position in ‘Forsyth-Edwards notation’. For example:
[Event "?"]
[SetUp "1"]
[FEN "1k1K4/1p5P/1P6/8/8/8/p7/8 w - - 0 1"]
1. h8=Q a1=Q 2. Qg8 Qa2 3. Qe8 Qa4 4. Qe5+ Ka8 5. Qh8 Qf4 6. Ke7+ Qb8 7. Qa1+ Qa7 8.
Qxa7+ *
(If the PGN file is only to be used in conjunction with the PGN Tool, it is unnecessary to preserve the header
labelled ‘SetUp’. This header may be required if the file is to be read by other applications.)