>  Docs Center  >  ENVI API  >  Processing  >  ENVITaskParameter::Validate

ENVITaskParameter::Validate

ENVITaskParameter::Validate

This method has been deprecated.

The Validate function method returns a Boolean value that indicates whether the Value passed to it is valid for the parameter. If the Value is invalid, then 0 is returned and the VALIDATION_EXCEPTION keyword will be populated with information on why the Value is invalid. This method allows the user to test the Value before setting the parameter’s Value and generating an error that must be handled by the user routine.

A simple way to check the valid settings for a specific property associated with a given ENVITask is to issue a PRINT statement on the ENVITaskParameter object. Then you can set the property with an acceptable value before running the task.

The ENVITaskParameter::Validate method is an advanced option for users who want to validate a given property at run-time execution.

Example


This example defines an incorrect data type value for ENVIRadiometricCalibrationTask, then shows how to validate the OUTPUT_DATA_TYPE property. Copy and paste the following code into the IDL command line:

; Start the application
e = ENVI()
 
; Get the radiometric calibration task from the catalog of ENVI tasks
task = ENVITask('RadiometricCalibration')
 
; Validate the OUTPUT_DATA_TYPE property to see if its value is valid,
; before running the task
param = task.Parameter('OUTPUT_DATA_TYPE') ; this is the ENVITaskParameter object
result = param.Validate('Int', VALIDATION_EXCEPTION=msg)
print, result

The result reported to the IDL console is '1', indicating that the OUTPUT_DATA_TYPE property has a valid value.

Now set OUTPUT_DATA_TYPE to a bad value:

result = param.Validate('Byte', VALIDATION_EXCEPTION=msg)
print, result
print, msg

Syntax


Result = ENVITaskParameter.Validate( Value [, VALIDATION_EXCEPTION=variable])

Arguments


Value

The value to test for validity. On successful return this argument will be typecast to the parameter's TYPE.

Keywords


VALIDATION_EXCEPTION

Set this keyword to a variable that will contain a message indicating the reason for any validation exceptions.

Version History


ENVI 5.1

Introduced

ENVI 5.4

Changed behavior and signature to match IDLParameter

ENVI 5.4, Service Pack 1

Deprecated

API Version


3.3

See Also


ENVITask, ENVITask::Validate



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us