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.
Kernel.bdh
Binlen( in sString : string allownull ) : number;
the actual data length the string is currently holding
Parameter | Description |
---|---|
sString | String whose data length is returned. |
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;
Strlen = 6 Binlen = 6 Strlen = 6 Binlen = 12