KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: String Overflow Errors in 4D v11 SQL
PRODUCT: 4D | VERSION: 11.5 | PLATFORM: Mac & Win
Published On: January 8, 2010

In versions prior 4D v11 SQL it was possible to pass an element beyond the string length. For example:

C_TEXT($myVariable)
C_TEXT($myChar)

$myVariable:="Hello World"
$myChar:=$myVariable[[13]]


In previous versions of 4D, the value of $myChar would be an empty string, and 4D would continue with the code execution. In version 11 this code will throw a Syntax Error 53; indice out of range. This error can be handled by checking the string length first or trapping the error with the ON ERR CALL method.