COBCH1860 LENGTH OF not supported - use SIZE OF with single dimensional managed arrays, strings or collections

the LENGTH OF operator is not allowed with object types.

Resolution:

Correct the code; then recompile. If you want to get the logical size of a managed array, string, or collection object, use SIZE OF.

Example:

The following example shows where SIZE OF should be used in lieu of LENGTH OF, as indicated.

           declare array1 = table of ("AAA" "BB" "C")
           display length of array1                         *> Error
           display size of array1                           *> ok
           declare s1 as string = "Hello"
           display length of s1                             *> Error
           display size of s1                               *> ok
           declare dict1 as dictionary[string, string]
           create dict1
           write dict1 from "X" key "X"
           write dict1 from "Y" key "Y"
           display length of dict1                          *> Error
           display size of dict1                            *> ok
           declare o1 as object
           display length of o1                             *> Error
           display size of o1                               *> Error, not a suitable type