This method adds a button to the ENVI menu under File > Open As > Custom that runs a custom file reader.

Note: This method should not be used inside of batch programs or while interacting with ENVI at the IDL command line.

Syntax


ENVI.AddCustomReader, Name, Routine [, Keywords=value]

Arguments


Name

A scalar string denoting the name of the menu button.

Routine

A scalar string denoting the name of the custom open procedure (an IDL procedure) that will be called upon clicking the menu button.

Keywords


Keywords are applied only during the initial creation of the object.

AFTER

Set this keyword to a scalar string with the name of a sibling button that the Name button will follow. You cannot use this keyword in combination with the BEFORE keyword.

BEFORE

Set this keyword to a scalar string with the name of a sibling button that the Name button will precede. You cannot use this keyword in combination with the AFTER keyword.

ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

PATH

Set this keyword to a scalar string denoting an optional sub-menu under which the menu button will be added (following File/Open As/Custom). You can add multiple sub-menus by using the forward slash character (/) between their names.

UVALUE

Set this keyword to a value containing information you want to maintain about the custom open procedure menu item. This value is passed into the custom open procedure as the UVALUE keyword.

Version History


ENVI 5.0.2

Introduced

API Version


4.3

See Also


ENVI function, ENVI::AddExtension