DeleteLayersOfDatacube

Declaration: DeleteLayersOfDatacube (FirstLayer, LastLayer: integer; FeedBack: boolean): integer;
The function DeleteLayersOfDatacube deletes the layers in the range specified by the parameters FirstLayer and LastLayer. Please note that layers can be deleted only if all selected layers belong to the same spectral group.

The Feedback parameter controls whether a visual feedback is given during the execution of this function. Please note that unless the script progress bar is already visible you have to make it visible before calling DeleteLayersOfDatacube, otherwise the feedback will not be displayed. You can activate the script progress bar by calling the function ScriptBar(0).

The function returns the following error codes:

 0 .... everything OK
-1 ... invalid layers (out of range)
-2 ... layers to be removed span more than one group