# match

The operation belongs to the family of predefined functions operating on templates. It allows the value of a variable or parameter to be compared with a template (it can be interpreted as an extended 'equality' operation). The operation returns a Boolean value.

- If the types of the template and variable are not compatible the operation returns false.
- If the types are compatible the return value of the operation indicates whether the value of the variable conforms to the specified template.

Related keyword:

- template

### match (value, template_instance)

- The match keyword introduces the operation.

- value a variable or a parameter that will be compared to the template.

- template_instance is a (receiving) template which the value is compared to.

Example 1

template integer tr_LessThan10 := (-infinity..9);
var integer vl_RxValue := 3;
var boolean vl_gyufa := match( vl_RxValue, tr_LessThan10))

The value of vl_gyufa will be true because the value of the variable vl_RxValue (3) matches the template tr_LessThan10.

BNF definition of match