[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 STD:Array Assign (Map)

The STD:Array Assign module maps array elements from several source arrays to a single destination array.

The destination and source can be the same, ie, you can map an array to itself. However, the source and destination ranges must not overlap (the system does not attempt to ensure a nondestructive move).

STD:Array Assign user interface configured with an example:

images/std-arrassign

The STD:Array Assign module uses range expressions to specify index positions. A range expression is a comma separated list of single numbers or pairs of numbers separated by a colon: `beg:end'. For example: `2', `18:34' and `3,7:10,14' are valid ranges.

There is only one destination array: it is specified by the Destination and Indices entry fields.

Destination. The name of the destination array. Here, the destination array is `X1'.

Indices. A range that specifies which indices of the destination array will be filled with values from the source arrays. If left blank, the destination array is filled from index 1. Here, `3:10' means that eight elements of `X1' will be filled: `X1(3)', `X1(4)' through `X1(10)'.

If not left blank, the destination indices range must be big enough to fit all the source elements, or Bunao will complain at runtime and exit.

There can be multiple source arrays. Each source array and its indices are specified on a separate line using the listcontrol. Here, three source arrays are listed.

Source: the source array name. Here, the source array names listed are `A1', `B1' and `C1'.

(Source) Indices: a range which specifies which indices of the of the source array to use when filling the destination array. If left blank, all elements of the source array are copied. Here, the source elements are `A1(1), B1(13), B1(15), B1(16), B1(17), B1(18), C1(2), C1(11)'.

Here, the following assignments happen:

 
A1(1)  --> X1(3)
B1(13) --> X1(4)
B1(15) --> X1(5)
B1(16) --> X1(6)
B1(17) --> X1(7)
B1(18) --> X1(8)
C1(2)  --> X1(9)
C1(11) --> X1(10)

module attribute list:
Attribute Type Default Description
darr array name (blank) array to fill
dind range (blank) destination range
fields (1) array name (blank) source array
fields (2) array name (blank) source range


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October, 28 2005 using texi2html