resize_array()

Creates a new array by copying an existing AEL array with resizing of the specified dimension. Note that if the dimension resize is bigger then the new elements of that dimension will be set to 0 or "". Since this function does not work on HPvars, ensure that the parameters passed are arrays.

See also: offset_array(), array_size(), array_type(), array_lowerBound(), array_upperBound(), convert_array().

Syntax:

new = resize_array(<arr>,<dim>,<min>,<max>)

where

arr is a valid AEL array.

dim is an integer that specifies which dimension of <arr> to resize in new array (ranges from 1 to inf).

min is an integer that specifies the lower bound of <dim> of new array.

max is an integer that specifies the upper bound of <dim> of new array.

new is a new valid AEL array.

Example:
decl a = {{1,2,3},{4,5,6}};
decl b = resize_array(a,1,0,5);
decl c = resize_array(a,2,0,1);
decl d = resize_array(a,2,-1,1);
decl e = resize_array(a,2,-1,3);
    fputs(stderr, identify_value(a)); // outputs {{1,2,3},{4,5,6}} 
    fputs(stderr, identify_value(b)); 
    // outputs {{1,2,3},{4,5,6},{<int>,<int>,<int>},{<int>,<int>,<int>},{<int>,<int>,<int>}}  
    // where <int> is uninitialized integer
    fputs(stderr, identify_value(c)); // outputs {{1,2},{4,5}}
    fputs(stderr, identify_value(d)); // outputs {{<int>,1,2},{<int>,4,5}}
    fputs(stderr, identify_value(e)); // outputs {{<int>,1,2,3,<int>},{<int>,4,5,6,<int>}}
Note
As demonstrated, you can add new elements to either the front or back of an existing array. In order to reset the offset back to 0 to max, see offset_array().

Where Used:

Measurement Expressions (Data Display equations and Schematic MeasEqns), Schematic, Layout, Simulation, GUI

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources