![]() |
![]() |
![]() |
![]() |
![]() |
The keyword octetstring denotes a basic string type whose distinguished values are the ordered sequences of 2n hexadecimal digits where n is a non-negative integer.
TITAN specific extension to the standard:
|
Related keywords:
octetstring |
const octetstring c_ok := 'A5'O;
The constant defined is called c_ok and contains the octet string A5.
const octetstring c_entier := int2oct (266,2);
The constant c_entier will contain the octet string 010A because the converted integer number (127 -> 10A) must be coded on 2 octets and therefore padded with a leading zero.
const boolean c_niet := ( c_entier == c_ok );
The constant c_niet will have the value false, because two octet strings are not equal. The parentheses are optional.
const octetstring c_clotre := c_entier & c_ok;
The constant c_clotre will contain the octet string 010AA5
const octetstring c_samotny := c_entier[1];
The constant called c_samotny will contain the octet string 0A.
const octetstring c_nil := ''O;
The constant called c_nil will be an empty string.
const hexstring c_kungsen := oct2hex ('AA'O);
The constant called c_kungsen will have the hexadecimal value AA. Although both values on the screen may look the same (AA), they have different types (octet string respective character string).
const integer c_prednost := oct2int ('55'O);
The constant called c_prednost will have the integer value 85. The result will be always positive.
const bitstring c_kvar := oct2bit ('44'O);
The constant called c_kvar will contain the bit string 01000100.
const charstring c_lettres := oct2str ('80FBBC0530A0'O);
The constant called c_lettres will contain the string 80FBBC0530A0 because the resulting character string has the double length as the octet string and contains only the characters '0' .. 'F'.
const integer c_laenge := lengthof ('80FBBC0530A0'O);
The constant called c_laenge will have the value 6 corresponding to the number of octets in the string .
const charstring c_specific := oct2char (â4469707379âO);
The constant called c_specific will contain the string "Dipsy" because the resulting character string will have the same length as the incoming octet string. The octets are interpreted as ISO/IEC 646 [8] codes (according to the IRV) and the resulting characters are stored in the returned string. Octet values higher than 7F cause an error.
var octetstring c_hinder ('1010'O,'77'O,'AA55CC'O );
The variable called c_hinder may hold the octet strings 1010, 77 and AA55CC only.
const octetstring c_go_round := '1122334455'O <@ (1+2);
The constant called c_go_round will hold the value '4455112233'O (the left operand rotated by three octets).
const octetstring c_slip := '1122334455'O << (1+1);
The constant called c_slip will hold the value '3344550000'O (the left operand shifted by two octets) .
BNF definition of octetstring
BNF definition of octetstring value