---
name: "current_field"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/current_field"
---

# current\_field(3)

set and get form page number

## NAME

**form\_page** - set and get form page number

## SYNOPSIS

```
#include <form.h>
```

**int set\_current\_field(FORM \****form***, FIELD \****field***);** **FIELD \*current\_field(const FORM \****form***);**

**int unfocus\_current\_field(FORM \****form***);**

**int set\_form\_page(FORM \****form***, int** *n***);** **int form\_page(const FORM \****form***);**

**int field\_index(const FIELD \****field***);**

## DESCRIPTION

**The function set\_current\_field sets the current field of the given** **form; current\_field returns the current field of the given form.**

**The function unfocus\_current\_field removes the focus from the current** **field of the form.** **In such state, inquiries via current\_field shall return a** *NULL* **pointer.**

**The function set\_form\_page sets the form's page number (goes to page** *n* **of the form).**

**The function form\_page returns the form's current page number.**

**The function field\_index returns the index of the field in the** **field array of the form it is connected to.** **It returns ERR if** **the argument is the null pointer or the field is not connected.**

## RETURN VALUE

**Except for form\_page, each routine returns one of the following:**

- **E\_OK**

  **The routine succeeded.**

- **E\_BAD\_ARGUMENT**

  **Routine detected an incorrect or out-of-range argument.**

- **E\_BAD\_STATE**

  **Routine was called from an initialization or termination function.**

- **E\_INVALID\_FIELD**

  **Contents of a field are not valid.**

- **E\_REQUEST\_DENIED**

  **The form driver could not process the request.**

- **E\_SYSTEM\_ERROR**

  **System error occurred (see [errno(3)](/errno/3.md)).**

## PORTABILITY

**These routines emulate the System V forms library.** **They were not supported on** **Version 7 or BSD versions.**

**The unfocus\_current\_field function is an** *ncurses* **extension.**

## AUTHORS

**Juergen Pfeifer.** **Manual pages and adaptation for new curses by Eric S. Raymond.**

## SEE ALSO

**curses(3X),** **form(3X)**
