FunctionParameter Object
Previous Top Next
FunctionParameter Object
The FunctionParameter Object class is a set of objects and functions that allow you to manage your input parameters in a EFS script.
FunctionParameter Constructor
FunctionParameter( paramString, paramType )
Parameter Types
FunctionParameter Methods
Usage
Previous Top Next
FunctionParameter Object
The FunctionParameter Object class is a set of objects and functions that allow you to manage your input parameters in a EFS script.
FunctionParameter Constructor
FunctionParameter( paramString, paramType )
paramString |
the name of the parameter as defined in main() |
paramType |
the type of parameter object. see Parameter Types below |
Parameter Types
FunctionParameter.STRING |
a string menu object. either a single string or a list of string options |
FunctionParameter.NUMBER |
a numeric menu object |
FunctionParameter.COLOR |
a color menu object |
FunctionParameter.BOOLEAN |
a boolean menu object |
FunctionParameter Methods
setName() |
set the display name of this menu item. This allows you to create a more descriptive name to display to the user |
addOption() |
add a string option |
setLowerLimit() |
set the lowest acceptable input value for a numeric menu option |
setUpperLimit() |
set the highest acceptable input value for a numeric menu option |
setDefault() |
set the default value for this menu option |
Usage
var aFPArray = new Array();
function preMain() {
var x; //initialize formula parameters
x = 0; //define a numerical menu option
aFPArray[x] = new FunctionParameter("Param1", FunctionParameter.NUMBER);
with (aFPArray[x]) {
setName("Numeric Menu Option");
setLowerLimit(5);
setUpperLimit(125);
setDefault(40);
}
x++; //define a string list menu option
aFPArray[x] = new FunctionParameter("Param2", FunctionParameter.STRING);
with (aFPArray[x]) {
setName("String Menu Option");
addOption("String1");
addOption("String2");
setDefault("String1");
}
x++; //define a color menu option
aFPArray[x] = new FunctionParameter("Param3", FunctionParameter.COLOR);
with (aFPArray[x]) {
setName("Color Menu Option");
setDefault(Color.blue);
}
x++; //define a boolean menu option
aFPArray[x] = new FunctionParameter("Param4", FunctionParameter.BOOLEAN);
with (aFPArray[x]) {
setName("Bool Menu Option");
setDefault(true);
}
}
//make sure that our 4 menu parameters are included in main's declaration
function main( Param1, Param2, Param3, Param4 ) {
}