6.2.7 Arrays

Add test
6.2.7 Arrays
 

Accessing elements outside the array's range will cause a compile-time or test case error.

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\NegSem_060207_arrays_007.ttcn1
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\NegSem_060207_arrays_002.ttcn1
Accessing elements outside the array's range will cause a compile-time or test case error.
 

All elements in an array value that are not set explicitly, are undefined.

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_003.ttcn1
All elements in an array value that are not set explicitly, are undefined.
 

Array dimensions may also be specified using ranges (with inclusive boundaries only)

Add test
Array dimensions may also be specified using ranges (with inclusive boundaries only)
 

Array elements are accessed by means of the index notation ([]), which shall specify a valid index within the array's range.

Add test
Array elements are accessed by means of the index notation ([]), which shall specify a valid index within the array's range.
 

Arrays can be used in TTCN-3 as a shorthand notation to specify record of types

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_011.ttcn1
Arrays can be used in TTCN-3 as a shorthand notation to specify record of types
 

Arrays may be declared as

Add test
Arrays may be declared as
 

Array dimensions shall be specified using constant expressions, which shall evaluate to a positive integer values

Add test
Array dimensions shall be specified using constant expressions, which shall evaluate to a positive integer values
 

Constants used in the constant expressions shall meet with the restrictions in clause 10

Add test
Constants used in the constant expressions shall meet with the restrictions in clause 10
 

multi-dimensional

Add test
multi-dimensional
 

single

Add test
single
 

Indexed value notation

Add test
 

If the value of the element indicated by the index at the righthand of an assignment is undefined, this shall cause an error

Add test
If the value of the element indicated by the index at the righthand of an assignment is undefined, this shall cause an error
 

Indexed value notation can be used  on left-hand side of assignments

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_008.ttcn1
left-hand side of assignments
 

Indexed value notation can be used on both the right-hand side

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_007.ttcn1
Indexed value notation can be used on both the right-hand side
 

The index of the first element shall be zero or the lower bound if an index range has been given

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_009.ttcn1
The index of the first element shall be zero or the lower bound if an index range has been given
 

The index shall not exceed the limitations given by either the length or the upper bound of the index

Add test
The index shall not exceed the limitations given by either the length or the upper bound of the index
 

Individual elements of multi-dimensional arrays can be accessed by repeated use of the index notation

Add test
Individual elements of multi-dimensional arrays can be accessed by repeated use of the index notation
 

Sending an array value with undefined elements shall cause an error

Add test
Sending an array value with undefined elements shall cause an error
 

Such an array is corresponding to a record of with a fixed length restriction

Add test
Such an array is corresponding to a record of with a fixed length restriction computed as the difference between upper and lower index bound plus 1 and indexing starting from the lower bound of the array definition.
 

The values of array elements shall be compatible with the corresponding variable or type declaration

Add test
The values of array elements shall be compatible with the corresponding variable or type declaration
 

They may be specified also at the point of a variable declaration

Add test
They may be specified also at the point of a variable declaration
 

Values may be assigned

Add test
Values may be assigned
 

Elements to be left out from the assignment shall be explicitly skipped in the list by using dash.

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_002.ttcn1
Elements to be left out from the assignment shall be explicitly skipped in the list by using dash.
 

When the value list notation is used, the first value of the list is assigned to the first element of the array

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_005.ttcn1
When the value list notation is used, the first value of the list is assigned to the first element of the array
 

individually by a value list notation

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_001.ttcn1
individually by a value list notation
 

individually by an indexed notation

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_002.ttcn1
indexed notation
 

more than one or all at once by a value list notation

Add test
more than one or all at once by a value list notation
 

multi-dimensional arrays

Add test
When specifying values for multi-dimensional arrays
 

Indexes of array slices shall correspond to the dimensions of the array definition from left to right

Add test
Indexes of array slices shall correspond to the dimensions of the array definition from left to right
 

Slice indexes shall conform to the related array definition dimensions.

Add test
Slice indexes shall conform to the related array definition dimensions.
 

The use of array slices of multi-dimensional arrays is allowed

Add test
The use of array slices of multi-dimensional arrays, i.e. when the number of indexes of the array value is less than the number of dimensions in the corresponding array definition, is allowed
 

each dimension that is assigned shall resolve to a set of values enclosed in curly braces

Add test
Test:Hits:
file:\\\D:\documents\ttcn3-workspace\ATS\06_types_and_values\0602_structured_types_and_values\060207_arrays\Sem_060207_arrays_013.ttcn1
For assigning values to multi-dimensional arrays, each dimension that is assigned shall resolve to a set of values enclosed in curly braces
 

the leftmost dimension corresponds to the outermost structure of the value

Add test
the leftmost dimension corresponds to the outermost structure of the value
 

the rightmost dimension to the innermost structure

Add test
the rightmost dimension to the innermost structure