dbnetsoft
RaceResultExchange
RaceResultExchange
  • General
    • Installation
    • Configuration
      • Exporter
      • WebHooks
    • Licensing
  • Operation Modes
    • Photofinish Sync
    • Displayboard
      • Modes
        • Countdown
        • Runtime
        • Passings
        • Timetrial
        • Lap Counter
      • Scripting
      • Brands/Models
        • FDS MLED
          • Scripting
            • Custom Functions
            • Startclock
            • Clock w/ flashing seperators
            • Conditional formatting difftime
            • Clock, Runtime, Gaptime (Globals)
            • Clock, Runtime, Gaptime (Offline)
            • Countdown to planned starttime and then runtime (Globals)
        • ALGE-Timing GAZ/D-Line
          • Scripting
            • Custom Functions
            • Clock
            • Clock w/ flashing seperator
            • Clock, Runtime, Gaptime
    • Triggered Actions
  • Scripting
    • Functions
    • Examples
      • Racemap
    • Globals
      • Variables
      • RR12 Lists
      • HTTP GET JSON
  • Release Notes
  • Frequently asked questions (FAQ)
    • Gap Time Reference is not set from external pushbutton
    • Accents not shown on FDS MLED
Powered by GitBook
On this page
  • RR12 Fields
  • Scripting

Scripting

PreviousTriggered ActionsNextFunctions

Last updated 8 months ago

RaceResultExchange comes with a powerful template/scripting engine.

The procedure when processing a script is always the same:

  1. Fields from RR12 enclosed in square brackets are retrieved from RR12 (e.g. [LastName]) and replaced with the placeholder.

  2. The scripting engine runs and formats the output.

RR12 Fields

Standard fields (e.g. for timing point), User-defined fields or User-defined functions can be requested from RR12 by putting the variable name in square brackets. E.g. pulling the lastname from RR12 you need to write [LastName]. You can also write [GetStageResult(1)] to access a user-defined function. In case you want to use the value inside a script, you have to make sure to include string values with surrounded quotation marks like this {{ lastnameVariable = "[LastName]" }}.

Scripting

Scripting is based on the powerful . You can find more information here:

  • Language Overview:

  • Built-in Functions:

Different than stated in the scriban docs, Race Result Exchange is not changing the casing of variables or functions. Even more, you can use string.ends_withor string.EndsWith, whereas the later is preferred as it means the declaration of the method is not touched.

The following script will output "Hello World":

{{ "Hello World" }}

The following script will modify the field from RR12 and pads it to 12 characters and center aligns it if need be. This is possible by using the | pipe character: The expression to the left is forwasrded to a function that is given by the name after the pipe. The forwarded argument will be the first in the function arguments list:

{{ "[LastName]" | TrimPad 12 "Center" }}

Without using piping, you can also use a traditional way of calling methods:

{{ TrimPad "[LastName]" 12 "Center" }}
Scriban scripting language
Here
Here