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
  1. Operation Modes
  2. Displayboard
  3. Brands/Models
  4. FDS MLED
  5. Scripting

Conditional formatting difftime

The diff field from RR12 is captured in the variable diffString. Then it is checked if the string starts with a "-". If so, set the color variable to green, otherwise to red. After that the color is output together with the diff string and trimmed.

{{ 
diffString = "+1.45"
colorString = ""
if string.StartsWith diffString "-"
    colorString = "Green"
else 
    colorString = "Red"
end
(mled.Color colorString) + (TrimPad diffString 8 "Right")
}}
PreviousClock w/ flashing seperatorsNextClock, Runtime, Gaptime (Globals)

Last updated 8 months ago