📄
SPAD.neXt
  • SPAD.neXt Manual
  • About SPAD.neXt
  • Getting Started
    • System Requirements
    • Supported hardware
      • Check Hardware
    • Installation
      • Simulation Specifc Steps
        • SimConnect Configuration
        • MSFS: Enable PMDG data access
        • X-Plane Configuration
    • First Start
      • Configuration Wizard
    • Common Tasks and Issues
      • SPAD
        • Online Services
        • Fresh reinstall
        • Move SPAD.neXt to new Computer
        • License Issues
      • MSFS Specific Topics
      • X-Plane specific Topics
      • Saitek/Logitech MP/RP blinking
      • USB Powermanagement
  • Guides and Videos
    • New User Series
    • MSFS SimConnect
    • L:Vars / H:Events and B:Events
    • Features & Functions
    • Device Specific
      • Arduino / SPAD Serial
      • Authentikit
      • Cockpit Simulator CDU
      • Honeycomb
      • Joystick (Generic HID)
      • miniCockpit
      • RealSimGear
      • Saitek/Logitech
      • Script Panel
      • Stream Deck
      • Thrustmaster TCA
      • vFIP
      • Virtual Avionics
      • vJoy
      • VRinsight
      • X-Touch MC Mode
      • X-Touch Midi Mode
    • Simulation Specific
      • ATR 600 (MSFS)
      • AS CRJ 550/700/900/1000 (MSFS)
      • FBW A32NX (MSFS)
      • FFX/MG HJet (MSFS)
      • FFX Vision Jet (MSFS)
      • FSW C414AW (MSFS)
      • PMDG 737 (MSFS)
      • PMDG 777 (MSFS)
      • SWS Kodiak (MSFS)
      • WT CJ4 (MSFS)
      • WT G1000 NXi (MSFS)
      • PMDG 777 (P3D)
  • User Interface
    • UI Familiarization
      • Home Page
      • Profiles Page
  • Features
    • Expressions
      • Values
      • Referencing Simulation Data
      • Operators
      • Functions
      • Examples
    • Tuner Acceleration
    • Event Execution Order
  • Simulations
    • MSFS 2024
    • MSFS 2020
    • X-Plane
      • Pre-Requisites
      • Dataref Tool
      • Helping Spad Help You
      • Dataref vs. Command: Know Your Copilots
      • Basic Flight Controls – Axis Setup
    • P3d and FSX
    • Other
  • Hardware specific
    • USB HUB Requirements
    • CPFlight Devices
    • Saitek FIP (Flight Instrument Panel)
      • Saitek FIP: Driver & Function Check
    • Loupedeck Image Devices
    • Midi Devices
      • X-Touch Mini
    • Serial (COM) Devices
    • Skalarki
    • VRInsight Overhead
  • Extending and API's
    • Gauges and Extensions
      • SPAD Gauges: GaugeSettings
    • C# Scripting Interface
      • C# Scripting: ScriptStub
      • C# Scripting: Provide Values
      • C# Scripting: PreCompile
    • Device Interface
      • Device Communication Flow
        • Device INIT-Phase
        • Device CONFIG-Phase
          • Device options
          • Device COLORSET configuration
          • Device PROFILE configuration
          • Device OUTPUT Configuration
          • Device INPUT configuration
            • Device input AXIS
            • Device input ENCODER
            • Device input PUSHBUTTON
            • Device input ROTARY
            • Device input SWITCH
            • Device input SWITCH3
            • Device LABEL
          • Device config: Advanced topics
        • Device STATESCAN-Phase
      • Device General Commands
      • Device commands
        • Page-Control
      • Device SPAD.neXt Events (2)
      • Device Simulation Events (Channel 4)
      • Device Data (Channel 5)
      • Device LED Update (Channel 6)
      • Device Display Update (Channel 7)
      • Device Input Updates (Channel 8)
      • Device Virtual Power
      • Device Custom UI
      • Device HTML UI
      • Device preconfigured definition
      • Serial V2
        • Command 1,RAISE
        • Command: 0,AUTH
    • X-Plane Datarefs & Commands
    • FSUIPC: Custom Offsets
    • RestAPI
    • HTML Rendering API
    • Other API's
  • FAQ
    • General FAQ
    • MSFS: Lost profile aircraft assigments
  • Changes
    • 0.9.21
    • 0.9.14.0
    • 0.9.13.39
  • Glossar
  • Old-Docs
    • Old-Getting-Started-Guide
Powered by GitBook
On this page

Was this helpful?

  1. Features
  2. Expressions

Functions

Name

Description

Usage

Result

Abs

Returns the absolute value of a specified number.

Abs(-1)

1M

Acos

Returns the angle whose cosine is the specified number.

Acos(1)

0d

Asin

Returns the angle whose sine is the specified number.

Asin(0)

0d

Atan

Returns the angle whose tangent is the specified number.

Atan(0)

0d

Ceiling

Returns the smallest integer greater than or equal to the specified number.

Ceiling(1.5)

2d

Cos

Returns the cosine of the specified angle.

Cos(0)

1d

Exp

Returns e raised to the specified power.

Exp(0)

1d

Floor

Returns the largest integer less than or equal to the specified number.

Floor(1.5)

1d

IEEERemainder

Returns the remainder resulting from the division of a specified number by another specified number.

IEEERemainder(3, 2)

-1d

Log

Returns the logarithm of a specified number.

Log(1, 10)

0d

Log10

Returns the base 10 logarithm of a specified number.

Log10(1)

0d

Max

Returns the larger of two specified numbers.

Max(1, 2)

2

Min

Returns the smaller of two numbers.

Min(1, 2)

1

Pow

Returns a specified number raised to the specified power.

Pow(3, 2)

9d

Round

Rounds a value to the nearest integer or specified number of decimal places. The mid number behaviour can be changed by using EvaluateOption.RoundAwayFromZero during construction of the Expression object.

Round(3.222, 2)

3.22d

Sign

Returns a value indicating the sign of a number.

Sign(-10)

-1

Sin

Returns the sine of the specified angle.

Sin(0)

0d

Sqrt

Returns the square root of a specified number.

Sqrt(4)

2d

Tan

Returns the tangent of the specified angle.

Tan(0)

0d

Truncate

Calculates the integral part of a number.

Truncate(1.7)

1

Timespan

Takes a number and interprets it a a timespan in milliseconds

Timespan(1000)

00:00:01.00

ToNumber

Converts the argument into a number (e.g. if it's a string)

ToNumber('100')

ToNumber([SIMCONNECT:ATC])

ToString

Converts the argument into a string

ToChar

Convert argument to a char

ToChar(int)

GetValue

Get the Value of the Reference the argument is pointing to.

GetValue('SIMCONNECT:ATC')

Format

Formats argument-1 using the formating rule argument-2

Format( 123.2356 , '0.00' )

123.23

SubStr

Extracts a subsctring SubStr(value, startIndex, [length]) Startindex can be negative to start at end

Len

Gets the Length of the argument as string

Concat

Concat a list of values to a string

Concat(val1,val2,val2,val3)

ToBCO16

Convert argument to BCO16

FromBCO16

Convert argument from a number to BCO16

ToBCD / FromBCD

Convert to/from BCD (Com frequencies) format

Select

Select a indexed value (index) from argumentlist (haystack)

Select([SIMCONNECT:SOMEPOSVAR],90,180,270,275)

Select(index,haystackevaluelist)

Rescale

Rescale a value linear from inMin...inMax to outMin..outMax

Rescale(value,inMin,inMax,outMin,outMax)

Count

Counts the number of occurences of a character in a string

Count(value,char)

Random

Create a Random number

Random() Random(max) Random(min,max)

In

Is a value in a list?

In(value,v1,v2,v3...)

if ( In([LOCAL:WINDDIRECTION],'North','East','West','South'), "Yeah" , "Invalid )

Replace (case-sensitive)

Replace all occourences of a string

Replace(input,old,new)

Replace('MyCoolString','Cool','Nice')

Replace (case insensitive)

Replace all occourences of a string (case insensitive)

Replace(input,old,new,1)

Replace('MycoolString','Cool','Nice',true)

IsMatch

Does string match a regular expression?

IsMatch(input,regex)

IsMatch('MyCoolString','.*Cool.*')

PreviousOperatorsNextExamples

Last updated 11 days ago

Was this helpful?