PML Customisation
User Guide
Arrays
:
Array Methods
: Length of String Array Elements
Length of String Array Elements
The length of the longest element in an array can be a useful thing to know, for example when
you
are outputting the values in table form.
You
can do this using the
Width()
method.
For example, in the array
!LIST
:
!LIST[1] 'One'
!LIST[2] 'Two'
!LIST[3] 'Three'
The command:
!Width = !List.width()
would set to
!Width
to the value 5, the length of the longest element in
!LIST
, which is
‘Three'
.
Note:
If the array contained elements that were not strings, these are ignored when calculating the maximum width.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.