Advantage Client Engine
Tells the Advantage Client Engine whether or not to null terminate strings returned to the calling application.
UNSIGNED32 |
AdsNullTerminateStrings (UNSIGNED16 bNullTerminate); |
bNullTerminate (I) |
If True, null terminate all strings returned to the calling application. If False, do not null terminate strings. The default setting is True. |
The null termination character (byte value 0) is commonly used to mark the end of character strings. If null termination is turned on, Advantage Client Engine functions will return the length of strings without the byte used for the null terminator on SUCCESS. If the buffer given was insufficient for the string and the null termination byte, the function will return AE_INSUFFICIENT_BUFFER and the required number of bytes passed back will include the null termination byte.
For example, suppose 10 bytes of data is to be returned via an Advantage Client Engine API call with null termination turned on. If the application passes a 10-byte buffer, the Advantage Client Engine will return the 10 bytes of data, set the length parameter to 11, and return AE_INSUFFICIENT_BUFFER. The Advantage Client Engine does not null terminate the string in this case. If the application passes an 11 byte buffer, the Advantage Client Engine will return the 10 bytes of data, set the 11th byte to null, set the length parameter to 10, and return AE_SUCCESS.
Note The null termination setting does not affect strings passed to the Advantage Client Engine. Functions such as AdsSetDefault require a null terminator to be in the string regardless of the setting.
AdsNullTerminateStrings affects ALL strings returned by the Advantage Client Engine. AdsNullTerminateStrings is a global setting the affects the behavior of the entire application.