settag

The settag filter consists of the keyword settag followed by arguments in parentheses. The first argument is the name of the tag to be set; the second argument is the value, which must be a string.
      settag("CustomTag1" "value of tag")
      settag("CustomTag2" "23")

The first argument must be a string literal.

The settag filter is intended for custom tags. It cannot be any of "Event", "Site", "Date", "ECO", "FEN", "Round", "Result", "EventDate". It also cannot begin with "White" or "Black".

The settag filter always matches unless its arguments do not match.

The settag filter only sets the value of a tag when the game in question is output to a file. Any tag filter querying that tag will use the original value of the tag.

-nosettag command line option

If the command line option -nosettag is set, then the settag filter does not change any tags.

Examples

Custom tags can be used for storing information about games in a way that is easy to parse or that are persistent without affecting the body of the game. For example, if one wanted a version of the HHdbVI database that keeps the original game number in the PGN header, once just run this script
    cql (input hhdbvi.pgn output hhdbvi-tagged.pgn silent)
    initial
    settag("hhdbgame" gamenumber)

The output will have a version of the HHdbVI database with the original gamenumber of each game in its PGN header to the file hhdbvi-tagged.pgn. When one creates a set of games from hhdbvi-tagged.pgn, it is easy to locate games from that database directly with a text editor.