Contents - Index


AlterValues (Macro Command)

 

The AlterValues macro command fills a column in an existing Parametric Table or Lookup Table with values in a specified manner.  The format  of this command is.

 

AlterValues 'TableName' VarName Rows=1..10  First=100 Last=550 {or Inc=50 or Mult=1.1} {Repeat or Apply}

AlterValues 'TableName' VarName Rows=1..10  Clear

 

where

 

TableName is the name of the existing Parametric or Lookup table, as shown on the tab.  Tablename may be a string constant (in single quotes) or a pre-defined string variable.

 

VarName is the name of the variable in the Parametric table or the name of the column in a Lookup table.  A pre-defined string variable may used here.

 

Rows=1..10  is the row range for which the command will be applied.  If the row range is not provided, the command will be applied to all rows in the column.  The lower and upper range may be provided with variables, e.g., Rows=R1..R2  where R1 and R2 are previously defined.

 

First is the value to be placed in the first row. First may be a numerical value or a previously-defined variable.

 

There are three mutually exclusive alternatives to define how the values in the following rows are filled. All of these alternatives may be provided with a numerical value or previously-defined variable.

Inc is the increment in the value of each row,    

Last is the value for the last row in the range.  The increment is then (Last-First)/(N-1) where N is the number of rows in the row range.

Mult is the factor which the value in the previous row is multiplied to provide the value in the next row.

 

Repeat and Apply are optional and they are mutually exclusive.  These options are useful for filling a table that will be used in factorial analysis.  These alternatives are best illustrated with an example.  

The following example uses a $RunMacroBefore directive to create a new Lookup table with 6 rows and 3 columns named X, Y, and Z.  The values of in the columns are then filled in 3 different ways.

 

$RunMacroBefore

   NewLookup 'Lookup 1'  Rows=6  Cols=3

   LookupColInfo  'Lookup 1'   1   X   

   LookupColInfo  'Lookup 1'   2   Y

   LookupColInfo  'Lookup 1'   3   Z

   AlterValues 'Lookup 1'  X   First = 1  Inc=1

   AlterValues 'Lookup 1'  Y   First = 1  Inc=1 Repeat=2

   AlterValues 'Lookup 1'  Z   First = 1  Inc=1  Apply=2

$endMacro

 

 

 

See also: Parametric macro command

 Lookup macro command

 

MacroCommands