Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: what does it imply by saying that optional fields shall be omittedusing ...

what does it imply by saying that optional fields shall be omittedusing ... 02 Jun 2003 08:17 #6489

  • Jacon_wang
  • Jacon_wang's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
>
> var MyRecord r1;
> r1 := {10,true};

The above is a valid assignment. Each field in your record has a 'concrete'
value.

. //after the assignment,is the value of r1.field1 equal to 10?
r1 := {omit,true};

The above is not legal TTCN-3. r1 would need to be declared as a template for
this
to be valid.
>>
The following is from clause 6.3.1.0
Or using an value list.
EXAMPLE 3:
MyRecordValue:= {MyIntegerValue, {'11001'B, true}, "A string"};
Optional fields shall be omitted using the omit symbol.
EXAMPLE 4:
Jacon's comment: Here , omit is assigned to a variable, not a template.
MyRecordValue:= {MyIntegerValue, omit , "A string"};
// Note that this is not the same as writing,
// MyRecordValue:= {MyIntegerValue, -, "A string"};
// which would mean the value of field2 is unchanged
>>
If one assumes that r1 is defined as a template, then the above is valid, and
r1.field will
now be absent if it is sent.


Comments anyone?

For some of us, the issue of assigning wildcards (matching mechanisms) to
variables, elements of a record, or set is somewhat unclear. :-).

Hope this helps.


Cheers,


Claude.

Claude Desroches email: This email address is being protected from spambots. You need JavaScript enabled to view it.



Conformance Technologies CDE email: This email address is being protected from spambots. You need JavaScript enabled to view it.
685 Cedar Point Road phone: +1 705 533 23 94
Penetanguishene, Ontario
Canada
L9M 1R3

Claude Desroches email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Solonplatz 3 phone: +49 30 9606 7986
13088 Berlin fax: +49 30 9606 7987
Germany
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin