PilotScript Parameter Validation Functions

The following parameter validation functions are available for PilotScript components.

The Parameter Validation functions indicate which parameter is being validated, lets the end-user know if a parameter is disabled, invalid, and allows you to set legal values for a parameter.

Parameter Validation Function Name/Prototype Description Example

ParameterName

String ParameterName()
In a validation, enabling, or legal values script, returns the name of the parameter being checked. This is especially useful when attempting to validate a parameter that is part of a series, such as with the Sort Data or XY Chart components.
/* part of an enabling script */
#parameterName := ParameterName();

SetDisabledDetails('Parameter ' . #parameterName . ' is disabled');

false;

Customize the disabled message based on the name of the parameter.

SetDisabledDetails

None SetDisabledDetails(String errorMessage)
In an enabling script, sets the flyover text for the parameter when the script returns false indicating that the parameter is disabled. This should attempt to explain to the user why the parameter is disabled and how to enable it.
SetDisabledDetails('The value of Other Parameter must be greater than or equal to 5');

Parameter('Other Parameter') >= 5;

An example of a simple enabling script that would disable the parameter for Other Parameter values less than 5. The flyover text of the parameter clearly indicates why the parameter is disabled.

SetInvalidDetails

None SetInvalidDetails(String errorMessage)
In a validation script, sets the flyover text for the parameter when the script returns false indicating that the parameter is invalid. This should attempt to explain to the user why the parameter is invalid and how to fix it.
SetInvalidDetails('The value must be greater than or equal to 5');
Parameter() >= 5;

An example of a simple validation script that would set the parameter to invalid for values less than 5. The flyover text of the parameter clearly indicates why the parameter is invalid.

SetLegalValues

None SetLegalValues(StringArray legalValues)
In a dynamic legal values script, sets the legal values for the parameter.
resize(legalvalues, 2); 
IF (Parameter('Mode') eq 'A')  THEN 
 legalvalues[1] := 'ala';
 legalvalues[2] := 'gly'; 
 ELSE 
 legalvalues[1] := 'asn';
 legalvalues[2] := 'asp';
END IF; 
SetLegalValues(legalvalues);

An example of a simple legal values script that would set the legal values for this parameter based on the value of the Mode parameter.