Log In    |    Knowledge Base    |    4D Home
Tech Tip: Length of C_STRING in Unicode mode
PRODUCT: 4D Developer | VERSION: 11 | PLATFORM: Mac & Win
Published On: July 30, 2008
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In 4D v11 SQL, when running in Unicode mode, C_STRING is equivalent to C_TEXT. This means that the maximum string length parameter in C_STRING will be ignored.

Here is an example highlighting the difference from 4D 2004:

4D 2004:

$varSize:=Length($var)  `$varSize = 0
$var:="1234567890"  `$var = 1
$varSize:=Length($var)  `$varSize = 1

In 4D 2004, the size of a variable created with C_STRING will never be greater then the string length parameter.

4D v11 SQL:
$varSize:=Length($var)  `$varSize = 0
$var:="1234567890"  `$var = 1
$varSize:=Length($var)  `$varSize = 10

In 4D v 11 SQL, the size of a variable created with C_STRING will adjust to the contents of the variable.

Note - 4D 2004 databases that have been converted to 4D v11 SQL and are running in compatibility mode will function the same as in 4D 2004.