DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
ETI forms

Obtaining field size and location information

This function enables you to determine the defining characteristics of a field -- its size, position, number of offscreen rows, and number of associated buffers.

   SYNOPSIS
   

int field_info (field, rows, cols, firstrow, firstcol, nrow, nbuf) FIELD * field; int * rows, * cols, * firstrow, * firstcol, * nrow, * nbuf;

Because 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.

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;
   

field_info (f, &rows, &cols, &firstrow, &firstcol, &offrow, &nbuf);

/* add up size of field and its terminator */

return (rows + offrow) * cols + 1; }

Note the use of the address operator ``&'' to pass field_info the requisite pointers to the locations used to return the requested field information.

If successful, function field_info returns E_OK. If not, it returns one of the following:


E_SYSTEM_ERROR -
system error

E_BAD_ARGUMENT -
NULL field pointer

Next topic: Dynamically growable fields
Previous topic: Manipulating field attributes

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004