# ispresent

This function returns the value true if and only if the value of the referenced field is present in the actual instance of the referenced data object.

Related keyword:

- boolean
- true
- false
- optional

### ispresent (any_type value)return boolean

- any_type value shall be a reference to a field within a data object that is defined as being optional.

Example 1:

type record MyRecordType {
boolean field1 optional,
integer field2
}
...

var MyRecordType v_MyRecordType;
...

MyPort.receive(MyRecordType: ?) -> value v_MyRecordType
{
if (ispresent(v_MyRecordType.field1))
{...}
...

The record MyRecordType with an optional field has been received and stored in a variable. Then the presence of field1 is checked. Decisions can be made on the result of the ispresent function.