ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0008217Part 01: TTCN-3 Core LanguageClarificationpublic10-11-2023 10:5110-11-2023 10:51
Gusztáv Adamis 
 
normalminorhave not tried
newopen 
 
 
6.2.3.0 and C.2.1
     Gusztáv Adamis Ericsson
0008217: Harmonisation needed btw 6.2.3.0 and C.2.1 (Lengthof does not count last, but not initialized elements.)
In 6.2.3.0 (Records and sets of single types/General) and C.2.1 (Length of strings and lists)

In Example 2 of 6.2.3.0 says that this array has 3 elements
EXAMPLE 2:
    var MyRecordOfType v_myVariable := {
        [0] := '111'B,
        [1] := '101'B,
        [2] := -
    }

    v_myVariable := { '10111'B, -, - };
    // after this, v_myVariable contains:
    // { '10111'B, '101'B /* unchanged */, <undefined> /* unchanged */ }

while the definition of the lengthof does not count this last, existing, but not initialized element. It is emphasized at the end of Example 1 of C.2.1.


    // Given
    type record length(0..10) of integer MyList;
    var MyList v_myListVar := { 0, 1, -, 2, - };

    lengthof(v_myListVar);
    // returns 4 without respect to the fact, that the element v_myListVar[2] is not initialized

This is according to the specification of lengthof, but normally we would wait 5 in this situation (as is suggested in 6.2.3.0.)
No tags attached.
Issue History
10-11-2023 10:51Gusztáv AdamisNew Issue

There are no notes attached to this issue.