[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

scanw, wscanw, mvscanw, or mvwscanw Subroutine

Purpose

Calls the wgetstr subroutine on a window and uses the resulting line as input for a scan.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>
scanw(Format, Argument1, Argument2, ...)
char *Format, *Argument1, ...;
wscanw(Window, Format, Argument1, Argument2, ...)
WINDOW *Window;
char *Format, *Argument1, ...;
mvscanw(Line, Column, Format, Argument1, Argument2, ...)
int Line, Column;
char *Format, *Argument1, ...;
mvwscanw(Window, Line, Column, Format, Argument1, Argument2, ...)
WINDOW *Window;
int Line, Column;
char *Format, *Argument1, ...;

Description

The scanw, wscanw, mvscanw, and mvwscanw subroutines call the wgetstr subroutine on a window and use the resulting line as input for a scan. The mvscanw and mvwscanw subroutines move the cursor before performing the scan function. Use the scanw and mvscanw subroutines on the stdscr and the wscanw and mvwscanw subroutines on the user-defined window.

Parameters

Argument Specifies the input to read.
Column Specifies the vertical coordinate to move the logical cursor to before performing the scan.
Format Specifies the conversion specifications to use to interpret the input. For more information about this parameter, see the discussion of the Format parameter in the scanf subroutine.
Line Specifies the horizontal coordinate to move the logical cursor to before performing the scan.
Window Specifies the window to perform the scan in. You only need to specify this parameter with the wscanw and mvwscanw subroutines.

Example

The following shows how to read input from the keyboard using the scanw subroutine.

int id;
char deptname[25];
 
mvprintw(5,0,"Enter your i.d. followed by the department name:\n");
refresh();
scanw("%d %s", &id, deptname);
mvprintw(7,0,"i.d.: %d, Name: %s\n", id, deptname);
refresh();

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The wgetstr subroutine.

Curses Overview for Programming, List of Curses Subroutines, Manipulating Characters with Curses in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]