¿Olvidó su contraseña? Inscripción
Syntax

Definition of Syntax (programming languages): The syntax of a computer language is the set of rules that defines the combination of symbols that are considered to be a correctly structured document or fragment in that language.

Definition of Syntax: The arrangement of symbols and characters to form expressions or functions.

 

Symbols and their names

The following are symbols used to write Expressions and functions.

[

Open bracket
] Close bracket
( Open or left parenthesis
) Close or right parenthesis
" Quote, quotation mark, or inverted comma
| Pipe, or vertical bar
& Ampersand
{ Open brace, squiggly brackets, or curly bracket
} Close brace, squiggly brackets, or curly brackets
; Semicolon
: Colon
# Hash

 

When to use each symbol

When to use Brackets?

Brackets are used when referencing a Field within an Expression or a function.

Example: If we want to reference a participant's Contest we would do this

[Contest]

Example: If we want to compare a participant's Contest to see if it matches a specified contest id we need to do this

[Contest] = 1

If a participant is in contest 1 when we reference [Contest] with the use of brackets we will get the value of 1 back. This would evaluate the above example as true because 1 does equal to 1.

 

When to use Parentheses?

Parentheses are used to contain parameters within a Function.

Example: If we wanted to write an if statement to return yes if a participant is in contest 1 otherwise return no we could do this

​​​​​​if(​[Contest]=1;"yes";"no")

In the above example, we are using an if statement with parentheses to contain our expression.

Parentheses are also used to define the order of operations.

Example: You have a variable laps race with a parade lap, where the parade lap is 1 mile and a full lap is 10 miles. You want to calculate how many miles each participant completes, including the parade lap. You could use parentheses to define the order of operations for this calculation.

​​​​​(​([NumberOfLaps]-1)*10)+1

First, we want to calculate the number of full laps a participant completes. To do this, we subtract 1 lap (the parade lap) from the NumberOfLaps data field. Then we need to multiply that value by 10 miles. Lastly, we need to add 1 mile for the parade lap. If we were to fill in the above example with 5 laps the result would be 41 miles, which is 4 10-mile laps and 1 parade lap of 1-mile distance. This example assumes that the start/lap/finish timing point is the same for all laps, normal laps and the parade lap.

 

When to use Braces?

Braces are used when referencing the value of a Record Multiplier within a List.

Example: If we wanted to reference laps 1 through 3 and the laps are named Lap1, Lap2, Lap3 under Main Window->Special Results then we could do this

[Lap{n}]

In the above example, we are referencing laps 1 through 3 by appending the text Lap with the value of the record multiplier which is defined within two braces.

Braces are also used to translate strings into different languages.

Example: If we want the example above to display "Yes" or "No" when using the software or my.raceresult.com in English, or "Si" or "No" for Spanish, we would write:

​​​​​​if(​[Contest]=1;"{EN:yes|ES:si}";"no")

Note that the value for the different languages is separated by a pipe.

Braces are also used to call a Splits Selector in an output list.

Example: To call a selector you need to surround the selector with braces like this:

{Selector}.TimePositive

 

When to use Quotes?

Quotes are used to reference a text string.

Definition of String (computer science): A string is traditionally a sequence of characters, either as a literal constant or as some kind of variable.

Example: If we wanted to find all participants with the first name of John then we could set a filter like this

[Firstname] = "John"

In the above example, John is in quotation marks because his name is a String we are trying to compare to. Firstname is in brackets because it is a field that will return a String value to compare with the String John.

 

When to use a Semicolon?

Semicolons are used to separate parameters within a Function.

Example: In an if statement there are three parameters. Each parameter needs to be separated with a semicolon like this

if([Bib]=1;"yes";"no")

In the above example, we are checking to see if Bib is equal to 1. If Bib is equal to 1 (true) then we return Yes otherwise (false) we return "No".

 

When to use an Ampersand?

Ampersands are used to append one string to another.

Example: If you want to add a string like "John" to a data field like [Lastname] then you can do something like this

"John " & [Lastname]

In the above example if the value of [Lastname] was "Doe" then the returned string would be "John Doe". This is also known as concatenating two strings together.

 

When to use a Hash?

A hash indicates that the expression is full-text. This way, you don't need to use quotes around text strings, and to use ampersands to combine fields, strings and functions. Fields and functions do need to be in square brackets.

Example: You can obtain the same result as above by writing the expression like this:

#John [Lastname]

 

 

 
×

¿Tiene alguna pregunta?

Nuestro equipo estará encantado de asesorarle personalmente.

¡Contáctenos!

El equipo de RACE RESULT estará encantado de evaluar sus necesidades, solucionar problemas y responder a cualquier pregunta que pueda tener. No dude en contactarnos a través del formulario.

Si tiene una pregunta de soporte, agregue su ID de evento.

He leído los términos de privacidad de datos .