Skip to main content



      Home
Home » Eclipse Projects » Eclipse Titan » Using a unbound optional field (record type optional field )
Using a unbound optional field [message #1804475] Tue, 26 March 2019 10:08 Go to next message
Eclipse UserFriend
There is an optional field in the record type I defined. When the optional area is empty, I don't assign a value. When I decode the record type with an external function, there is a "using an unbound optional field" error. How can I solve it?
Re: Using a unbound optional field [message #1804479 is a reply to message #1804475] Tue, 26 March 2019 11:39 Go to previous message
Eclipse UserFriend
All fields of a record value must be initialized, even optional fields, before it can be used in most operations. If you don't want to give a real value to an optional field, you have to set it to 'omit'.

For example:
type record MyRecord {
  integer field1,
  charstring field2 optional
}
...
var MyRecord x1 := { field1 := 1, field2 := omit }


You can also set all uninitialized optional fields to 'omit' with the attribute 'optional "implicit omit"'.

For example:
var MyRecord x2 := { field1 := 2 } with { optional "implicit omit" }
Previous Topic:RIoT - the IoT load/performance generator based on TTCN-3 and Titan
Next Topic:RAW Encoder and Decoder
Goto Forum:
  


Current Time: Sat Jul 05 00:16:51 EDT 2025

Powered by FUDForum. Page generated in 0.03021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top