userVariable: <name> <type> [default=value][description=string]
[units=value][upperBound=value]
[lowerBound=value]
[enumValues=val1,val2,...,valN]
[enumAliases=val1,val2,...,valN]
| Name | Description |
|---|---|
| name | The name is a string that specifies what the variable will be called. |
| type | The type can be any primitive type supported by the Analysis Server: double, integer, string, and boolean. |
| Name | Description |
|---|---|
| default | This option can be used to specify a default value. |
| description | This option allows the user to write a description for the variable. |
| units | This option allows the user to write a units string for the variable. |
| upperBound | This option allows the user to set an upper bound for the variable. |
| lowerBound | This option allows the user to set a lower bound for the variable. |
| enumValues | This option allows the user to specify the set of possible values for the variable. The enumerated values are specified as a comma separated list of values. |
| enumAliases | New as of build 169. This option allows the user to specify a set of string values that may be associated with the enumerated values. If the variable is set to a value in the alias set, the actual value will be set to the corresponding value in the enumValues set. The aliases are specified as a comma separated list of values. There must be the same amount of elements in the enumValues and enumAliases sets. |
userVariable: outFileName string default=out.datIn this example, a user variable named "outFileName" was created. This variable was then used in both the run statement and the fileToParse statement.
RunCommands
{
generate inFile
run "myProg in.dat $outFileName"
parse outFile
}
RowFieldOutputFile outFile
{
fileToParse: $outFileName
...
}
Note: As of build 191, curly braces can also be used to indicate where to substitute values. For example, to specify the same name for the input and output files in the above example, the following commands could be used:
userVariable: fileName string default=values
RunCommands
{
generate inFile
run "myProg ${fileName}.in ${fileName}.out"
parse outFile
}
RowFieldInputFile outFile
{
fileToGenerate: ${fileName}.in
...
}
RowFieldOutputFile outFile
{
fileToParse: ${fileName}.out
...
}
See also Analysis Server | FileWrapper | FileWrapper Statements