Create Array

Creates a one or two dimensioned array for storing multiple items in sequential order with the same variable name. A one-dimensional array has one column, a two-dimensional array has multiple columns, and a three-dimensional array could be thought of as having multiple pages, each containing multiple rows and columns.

An array is a special type of AWE variable used to store data with multiple rows and/or columns. It could be useful to create an array to store data read from a text file or other system containing customer data. If there were 10 customers, the array would need to have 10 rows, if the data consisted of first name, last name, and company name it would need 3 columns and would need to be a two dimensional array. An array can also be a simple list of text values (multiple rows only, one column), called a one-dimensional array.

To set Create Array properties

  1. In the Available Actions pane, open the Variables folder and double-click the Create Array action or drag it into the Steps pane.

  2. In the Array Name box, enter a name for the array. Be sure the name is unique and does not conflict with any BASIC scripting keywords such as date, day, week, etc. One safe way to do this is to always include identifying characters, such as AR, in array names (for example, DayAr).

  3. If the array is to have only one dimension, enter the number of rows in the One dimension box.

  4. If the array is to have multiple dimensions, select the applicable specification and enter the dimensions in the boxes provided.

  5. If you want to include a description for the array, enter it in the Description box. The description will be displayed in the Variables tab of the Task Builder debug window.

  6. To specify the variable type, click the Advanced tab and select from the following:

  7. To set the Description tab properties, refer to Description Tab Options.

  8. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  9. When finished, click OK to save settings and close the properties dialog box.

Declaration

<AMARRAY NAME="text" ROWS="text" COLUMNS="text" DEPTH="text" DESCRIPTION="text" ISPARAMETER="YES" PRIVATE="YES" />

See Also: Create Array, Create Object, Create Variable, Decrement Variable, Define Type, Increment Variable, ReDim Array, Set Variable

General Tab

Property

Type

Required

Default

Markup

Description

Array Name

Text

Yes

(Empty)

NAME="myarray"

The name of the array to create. It is important that this value is unique, descriptive and does not conflict with any BASIC scripting keywords (examples of common conflicts include: date, day, week, etc).

Rows

Number

Yes

0

ROWS="4"

The number of rows that should be allocated in the variable. If only the ROWS parameter is specified and columns is omitted, a one dimensional array is created.

Columns

Number

Yes

0

COLUMNS="4"

The number of rows that should be allocated in the variable. If only the ROWS parameter is specified and columns is omitted, a one dimensional array is created.

Description

Text

No

(Empty)

DESCRIPTION="This variable holds the date"

An optional text description that describes the purpose of the variable, this information will be displayed at design time in the Variables information window.

Attributes Tab

Property

Type

Required

Default

Markup

Description

Variable Type

Text (options)

No

Auto

TYPE="TEXT"

Causes the variable to assume a specific type. The available options are:

  • Auto: Variable will auto-detect whether it contains a number or text. Variable will adapt to the proper type when possible depending on the operation being performed.

  • Text: Variable will always be treated as text regardless of it's contents. If an operation is attempted that is only valid for numbers, an error will be thrown.

  • Number: Variable will always be treated as a number regardless of it's contents. If an operation is attempted that is only valid for numbers, an error will be thrown.