CRField::getChars
Previous  Index  Next

const char* getChars();
char* getChars(char* result);
char* getChars(char* result, int length);

Return Value

Zero-terminated string of chars.

Parameters

result
Buffer to hold copy of the field value.  
length
Number of characters to be copied.  

Description

Call this member function to retrieve field data in the current record represented as a string. For the function that does not have length parameter result parameter represents a buffer long enough to hold zero-terminated copy of the field value. For getChars function with length parameter, if length is less than or equal to the length of result, a null character is not appended automatically to the copied string. If length is greater than the length of result, the destination string is padded with null characters up to length value. Throws an exception when type conversion is not possible.

Example

  char* dName;
  char buffer[100];

  dName = dataset.field("DName").getChars();
  dataset.field("DName").getChars(buffer);

See Also

CRField::setString, CRField::setChars


CRField | Classes | OCL | Index