Binlen Function

Action

Returns a string's data length. In contrast to the Strlen function Binlen does not return the string length, which is the number of characters until the first '\0' character, but returns the real data length stored in the string.

Include file

Kernel.bdh

Syntax

Binlen( in sString : string allownull ) : number;

Return value

  • the actual data length the string is currently holding

Parameter Description
sString String whose data length is returned.

Example

dcltrans
  transaction TMain
  var
    sString : string;
  begin
    sString := "String";

        Print("Strlen = " + string(Strlen(sString)));
    Print("Binlen = " + string(Binlen(sString)));
    sString := sString + "\h001122334455";

        Print("Strlen = " + string(Strlen(sString)));
    Print("Binlen = " + string(Binlen(sString)));
  end TMain;

Output

Strlen = 6
Binlen = 6
Strlen = 6
Binlen = 12