Titan



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:


ispresent (any_type value)return boolean


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.