|
|
This function enables you to determine the defining characteristics of a field -- its size, position, number of offscreen rows, and number of associated buffers.
SYNOPSISBecause function field_info must return more than a single value and C passes arguments to functions ``by value'' only, field_info uses the pointer arguments rows, cols, firstrow, firstcol, nrow, and nbuf. These arguments are pointers to the locations used to return the requested information: the number of rows and columns comprising the field, the field starting location relative to the origin of its form subwindow, the number of offscreen rows, and the number of additional buffers.int field_info (field, rows, cols, firstrow, firstcol, nrow, nbuf) FIELD field; int rows, cols, firstrow, firstcol, nrow, nbuf;
As an example, consider how you might use field_info to determine a field's buffer size. You fetch the field's number of onscreen and offscreen rows and number of columns, and do the arithmetic, thus:
int bufsize (f) FIELD * f; { int rows, cols, firstrow, firstcol, offrow, nbuf;Note the use of the address operator ``&'' to pass field_info the requisite pointers to the locations used to return the requested field information.field_info (f, &rows, &cols, &firstrow, &firstcol, &offrow, &nbuf);
/* add up size of field and its terminator */
return (rows + offrow) * cols + 1; }
If successful, function field_info returns E_OK. If not, it returns one of the following: