LENGTH ( string raw-expression blob-field , type )A character expression. The specified string can be a character string, a CLOB field, or a LONGCHAR variable. and may contain double-byte characters.A character expression that indicates whether you want the length of string in character units, bytes, or columns. A double-byte character registers as one character unit. By default, the unit of measurement is character units.There are three valid types: "CHARACTER," "RAW," and "COLUMN." The expression "CHARACTER" indicates that the length is measured in characters, including double-byte characters. The expression "RAW" indicates that the length is measured in bytes. The expression "COLUMN" indicates that the length is measured in display or print character-columns. If you specify the type as a constant expression, ABL validates the type specification at compile time. If you specify the type as a non-constant expression, the AVM validates the type specification at run time.In this procedure, the LENGTH function returns the number of bytes in the Name of number 29. The procedure returns a 15, the number of bytes in the Name, Bug in a Rug-by.
DEFINE VARIABLE ix AS INTEGER NO-UNDO.FIND Customer NO-LOCK WHERE Customer.CustNum = 29.ix = LENGTH(Customer.Name, "RAW").DISPLAY Customer.Name ix LABEL "Byte Length".If the value of the expression is the Unknown value (?), the LENGTH function returns the Unknown value (?).
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |