6.5
© 2007 ABBYY. All rights reserved.
52
2. For Max and Min, the result is the maximum and minimum element respectively.
3. For
NumMax and NumMin, the result is the number of maximum and minimum element (in the operand value).
4. For
First and Last, the result is the first and the last element respectively.
5. For
Count, the result is the dimension of the operand’s value.
6. For
Same, the result is True if all elements of the operand are the same, and False otherwise.
7. For
Unique, the result is True if all elements of the operand are different (no repetitions), and False otherwise.
Examples. Let the value of the #A!Sum# reference be a multidimensional constant {2, 1, 4, 4.6, 0, 4}, then
Sum(#A!Sum#) is {12.6}
Prod(#A!Sum#) is {0}
Avg(#A!Sum#) is {2.1}
Max(#A!Sum#) is {4.6}
Min(#A!Sum#) is {0}
NumMax(#A!Sum#) is {4}
NumMin(#A!Sum#) is {5}
First(#A!Sum#) is {2}
Last(#A!Sum#) is {4}
Count(#A!Sum#) is {6}
Same(#A!Sum#) is {False}
Unique(#A!Sum#) is {False}
String processing operators: UCase, LCase, Len, Trim
Syntax. <ME>::= ( … | <String processing operator> (<МE1>) | … )
<String processing operator> ::= ( UCase | LCase | Len | Trim )
Meaning.
Before the operation begins, the value of the МE1 operand is converted to a string. The required operation is performed
element by element, so that the result dimension will be the dimension of the operand:
• UCase and LСase – the string is converted to upper or lower case, respectively,
• Len – returns the string length (the number of characters),
• Trim – cuts the left and right spaces.
Examples.
LCase({`i SaId tHe RoOk `,`5+3 EQUALS 8`}) is {`i said the rook`,`5+3 equals 8`}
Len ({` fghj jk `, `2`}) is {9 , 1}
Trim ({` fghj jk `, ` 2 1`}) is {`fghj jk`, `2 1`}
Part–of–date operators: Year, Month, Day
Syntax. <MR>::= ( … | <Part–of–date operator> (<MR1>) | … )
<Part–of–date operator> ::=( Year | Month | Day )
Meaning.
Before performing the operation, the value of the МE1 operand is converted to the Date type. The required operation is
performed element by element, so that the result dimension will be the dimension of the operand. The Year, Month, and Day
operators return the year, month, and day of the provided date respectively.
Examples.
Year(`20/1/1`) is 2001
Month(`20.02.01`) is 2
Day({`2.22.1`,`31/1/20`}) is {22,31}
IsError operator
Syntax. <MR>::= ( … | IsError (<MR1>) | … )
Meaning. The result dimension is the dimension of the operand MR1. Each element is True if the respective element of the operand is
Error, and False otherwise.
Example.
IsError (Array (2+3, 2/0, `3a` – 2)) is { False, True, True }
Error operator
Syntax. <MR>::= ( … | Error (<MR1>) | … )
Meaning. The MR1 dimension must be 1; its value must be able to be converted to a string. The result will be a single Error element;
the description of the error will be the string in the MR1 operand.
Abs operator
Syntax. <MR>::= ( … | Abs (<MR1>) | … )
Meaning.
Before the operation begins, the value of the МE1 operand is converted to the Real type. The operation gets the absolute
value of each element. The result dimension will be the dimension of the operand MR1.
Example.










