LEN()
Posted: Mon Apr 11, 2016 6:35 am
To summarise several days painful fault-tracing into a few calm words...
len() works ok with string literals "like this" but not with string variables because they cause an esp reset.
The attached bit of code demonstrates the problem which exists on my setup, so I hope will also be replicated for others. My esp is being used in AP mode in case that has any relevence.
Intrepid Bug Hunters be warned, this monster has no respect for authority and rampages through both Alpha 7 and 9.
It's powers seem to strengthen the deeper it is in a long script, and it can attack from the most unlikely and innocent places, such as within the string quotes of udpreply " the len monster could even be lurking in here to cause an esp reset".
It's hiding place is not consistent, so I dedicated a whole session to changing EVERY occurance of the 'len'gth characters into some alternative string, ie: "lngth" to prevent some weird esp resets.
len() works ok with string literals "like this" but not with string variables because they cause an esp reset.
The attached bit of code demonstrates the problem which exists on my setup, so I hope will also be replicated for others. My esp is being used in AP mode in case that has any relevence.
Intrepid Bug Hunters be warned, this monster has no respect for authority and rampages through both Alpha 7 and 9.
It's powers seem to strengthen the deeper it is in a long script, and it can attack from the most unlikely and innocent places, such as within the string quotes of udpreply " the len monster could even be lurking in here to cause an esp reset".
It's hiding place is not consistent, so I dedicated a whole session to changing EVERY occurance of the 'len'gth characters into some alternative string, ie: "lngth" to prevent some weird esp resets.
Code: Select all
print len("123") & len("ABCEF") & " This line proves that len() can do string literals"
let number = 123 + 4 ' just a test number proving its a number
let length = 10 - 1 ' just a test length number proving it is a number
let string = str(number)
print "number=" & number & " length number=" & length & "string of number=" & string
print "next line tries to do len() of string variable but causes esp to reset if uncommented"
' let length = len(string) 'uncomment this line to show that len() cannot do string variables"
print "length=" & length & " just to prove that the problem is caused by the line above"