map_clear_from()

Purpose

Clears a map from the screen

Old name

#define clearmap map_clear_from

Syntax

void map_clear_from(mapnr)

Parameters

int mapnr

Number of map to be cleared

Description

The function map_clear_from() removes the specified map, and all maps drawn after it, from the screen. Clearing a map which is not on the screen has no effect.

See also

map_clear_after(), map_clear_all(), map_change()

Example

/* A simplified example of typical mistake in using
of map_clear_from. This can be avoided by
displaying and clearing maps locally. Functions
which display maps should be responsible for
clearing them. */
int get_name()
{
askf_c(1,1,customer.name);
map_clear_from(1);
}
map_draw(1,RETAIN);
/* this should be in get_name */
map_draw(2,RETAIN);
/* get_name clears map 1 and hence map 2 */
get_name();
/* an error now occurs map 2 has been cleared */
askf_c(2,1,region.region_id);