Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Data operation(Data operation)
Data operation [message #1803422] Thu, 28 February 2019 14:08 Go to next message
le tian is currently offline le tianFriend
Messages: 16
Registered: October 2018
Junior Member
I want to implement the arithmetic sum of hexadecimal numbers. Their results are expressed in hexadecimal numbers without considering overflow bits. How can I achieve it?
Re: Data operation [message #1803429 is a reply to message #1803422] Thu, 28 February 2019 15:42 Go to previous message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 36
Registered: February 2016

I'm not sure I understand the question...
Hexstrings and octetstrings cannot be added directly in TTCN-3, but they can be converted to integers, and their sum can be converted back.

For example:
var octetstring x1 := '1234'O;
var octetstring x2 := '00FF'O;
var octetstring y := int2oct(oct2int(x1) + oct2int(x2), lengthof(x1)); // result: '1333'O

Hope this helps.

Best regards,
Botond Baranyi
Previous Topic:variable definition
Next Topic:Translation ports vs dual-faced ports part2
Goto Forum:

Current Time: Thu Aug 05 11:09:50 GMT 2021

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

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

Back to the top