Magic-7.3 Command Reference

#

## array

Array everything in the current selection

### Usage:

> array option

> > where option is one of the following:
> > xsize ysize
> >   Array the selection with xsize copies in the x (horizontal) direction and ysize copies in the y (vertical) direction. Array pitch is determined by the current cursor box.
> > xlo xhi ylo yhi
> >   Array the selection with indices xlo, xhi, ylo, and yhi inclusive. Thus, (xhi - xlo + 1) copies will be created in the x direction and (yhi - ylo + 1) copies will be created in the y direction. Arrayed cell uses will be numbered according to the indices. Array pitch is determined by the current cursor box.
> > count [[xlo] xhi [ylo] yhi]
> >   With no arguments, returns the array indices of the currently selected cell. With arguments, is equivalent to the first two options (see above).
> > width [value]
> >   With no arguments, returns the array spacing in x of the currently selected cell. With arguments, redefines the spacing in x between cells in the array.
> > height [value]
> >   With no arguments, returns the array spacing in y of the currently selected cell. With arguments, redefines the spacing in y between cells in the array.
> > pitch [x y]
> >   With no arguments, returns the array spacing in x and y of the currently selected cell. With arguments, redefines the spacing in x and y between cells in the array.
> > position [x y]
> >   With no arguments, returns the position of the array origin. With arguments, redefines the array origin.
> > help
> >   Print help information

### Summary:

> The array command creates multiple copies of the current paint selection. In the case of selected paint, only the first two options are available, and the function makes multiple copies of the selected paint in the x and/or y direction(s). In the case of selected cells, the cell is copied multiple times but is maintained in the database as an array type, rather than multiple individual uses. As an array type, certain functions such as move or copy operate on the array as a single unit, and subsequent calles to the array command may resize the array.

> The cursor box defines the pitch between cells or paint copies in the array. The height of the box is the pitch in y, and the width of the box is the pitch in x.

> The Tcl version allows useful constructs on the command line such as:

> > array width [expr {1 + [array width]}]
> > move s [array height]

> The first example expands the pitch of the array by 1 unit in the x direction without requiring explicitly sizing the cursor box to match the array pitch. The second example moves the array down by the y

> ### Implementation Notes:

> > array is implemented as a magic built-in command. Command options which return values from a selected array generate Tcl results in the Tcl version of magic.

> Return to command index

> Last updated: March 7, 2020 at 1:06pm