map_activate()

Purpose

References earlier map copies

Old name

#define activate map_activate

Syntax

int map_activate(mapnr, fieldnr)

Parameters

int mapnr

Number of underlying map containing attached maps

 

int fieldnr

Number of field on map with attached map to activate

Description

The map_activate() function allows you to reference earlier copies of an attached map, still present on the screen. Normally, it is only the most recently attached copy of the map which is referenced by the askf_x(), scrnx_map(), inpm_x() and show_x() functions.

map_activate() causes any maps attached to the specified map and field to become the active copy of the map.

The function map_activate() does not affect the map referenced by the function map_change(), which always refers to the most recent 'non-dead' copy of a map.

This function is not commonly used and is likely to be withdrawn in the future.

Return values

The number of the map which was activated

Example

/*
C Functions Reference Manual
----------------------------
Filename: MAP_ACTI.C
Example: map_activate
Purpose: Simple example to show logic of
map_activate. The program activates
multiple copies of a map attached to the
fields or another map, and displays the
number of the field in the map.
*/

/*
#db salesord
#c
#end
*/

#include "dp4.h"
#include "map_acti.h"
/* generate this file by running LIBMAKE */
void process()
{
int i;
map_draw(1,RETAIN);
/* attach map 2 to 10 fields in map 1 */
for (i = 1; i < 11; i++)
map_attach(1,i,2,DEFAULT);
/* display numbers 1 to 10 in the copies
of map 2 */
for (i = 1; i < 11; i++)
{ /* activate map 2 attached to i'th field */
map_activate(1,i);
show_h(2,1,i);
}
/* pause */
askf_special(1,11,0);
}