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

Counting the number of fields

The following function returns the number of fields connected to the given form.

SYNOPSIS

   int field_count (form)
   FORM * form;
If form is NULL, field_count returns -1.

As an example, consider the following routine, which determines whether your user is on the last field of the form as numbered in the field pointer array:

   int on_last_field (form)
   FORM * form;
   {
       /* fetch number of last field */
   

int lastindex = field_count (form) - 1;

/* determine whether number of current field is the same */

return field_index (current_field (form)) == lastindex; }

Note the use of functions field_index and current_field, described in ``Manipulating the current field''.


Next topic: Querying the presence of offscreen data
Previous topic: Changing and fetching the fields on an existing form

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