ZeeGrid Programming Reference

Cell TEXT Register


Cell TEXT Register

Every ZeeGrid cell has a TEXT register.

The TEXT register is an internal character pointer variable. When a cell's TEXT value is set, ZeeGrid will analyze the text to determine its data type. This type could be BOOLEAN (TRUE/FALSE), a date, text, or a numeric value. This analysis is determined by the settings of ZGM_INTERPRETBOOL, ZGM_INTERPRETDATES, and ZGM_INTERPRETNUMERIC. If these settings are turned off, the text will be treated as a text string, no matter what the text string represented.

The TEXT register holds the character string that represents the actual data that is stored. If the cell holds a numeric value, the TEXT register will hold the text string that is displayed to represent that number. For example, if the numeric value stored in the cell is 3.1415926535, and the PRECISION attribute for that cell is set to 4, the TEXT register will hold the string "3.1416". Retrieving the text representation of the number from the TEXT register will likely not be equal to the numeric value stored in the NUMERIC register. To retrieve accurate numeric results, always use ZGM_GETCELLINT or ZGM_GETCELLDOUBLE when getting numeric values from cells. Use ZGM_GETCELLTEXT to retrieve cell text.

Use ZGM_GETCELLTEXTLENGTH to first determine the length of the string when the length might be unknown. You can use the length returned to create a dynamic variable to hold the actual text with ZGM_GETCELLTEXT.

ZeeGrid messages that are related to the TEXT register:

ZeeGridTMCopyright © 2002-2016 by David Hillard