For forums, blogs and more please visit our
Developer Tools Community.
By: Borland Staff
Abstract: You must account for the null character at the end of the string.
How do I have to declare the input parameter of a UDF if I want to call it with a maximum length of n
characters? If I define it as "cstring(n)", I get an error ("string truncation...") when I call it with a maximum
length string. When I try it with cstring(n+1) it works. Is this the right way to declare it?
Note: This information applies to all InterBase versions.
Cstrings are null terminated. As a result, you have to take into account the fact that there is an extra
character on the end of the string. Otherwise, you are trying to force the system to truncate the
last character in the string, the null character.
Could not retrieve comments. Please try again later.
Free Developer Edition!
Click here to download a free non-expiring Developer Edition or 30-day trial >
More InterBase Info
InterBase XE7 Product Info
Free Developer Edition download
InterBase on Google+
Follow @InterBase on Twitter
Server Response from: ETNASC03