setVariable()

This method sets a variable in the boundaries to the specified value, automatically creating the variable if it doesn't exist yet.

Boundary variables are carried over from one iteration of the Boundaries script to the next, while native JavaScript variables are not.

setVariable(varName, varValue)

Sets variable varName to value varValue.

varName

String name of the variable of which the value is to be set.

varValue

Object; value to which the variable has to be set.

Example

This script examines a specific region and stores its contents in a variable in the boundaries.

Copy
var addressRegion = region.createRegion(10, 30, 100, 50);
var addressLines = boundaries.get(addressRegion);
boundaries.setVariable("previousLines",addressLines);