len() reads wrong count

Previous topic - Next topic


I use the len() function with  a variable is filled with the SOCK_RECV Command. len() tells me that the String has 45 Chars. But the String has 220 Chars. In the String are more Chars with an value less then 30.

Die Len() Funktion gibt eine falsche Zeichenanzahl zurück bei einen mit SOCK_RECV Empfangenen String der ASC-Zeichen kleiner 30 enthält.


It works for me
Try all the combinations

// Project: len
// Start: Monday, April 24, 2017
// IDE Version: 14.497
FOR k=1 TO 20000
   FOR i=1 TO count
   IF LEN (a$)<>count
      PRINT "error  " + LEN (a$),0,100
PRINT "OK",0,100
SLEEP 1000

Ian Price

Can you post the string here? If it is a bug, then having the actual string can help solve it easier?

Maybe certain chars are not counted? Dunno. More info from you will help identify the problem.
I came. I saw. I played.


Ok, i solved the problem.
The error was by my.  :nw:
I changed the programm for output the string to file. Suddenly the value of len() was ok. It was an error by printing the value.
Thanks to all.
Greatings Uwe

Ian Price

Jobs a good'un. :D

Human input is generally the biggest bug in coding! :P
I came. I saw. I played.