Declaration: TSpecCollection.DeleteItemByIndex (ItemIdx: integer): integer;
The method DeleteItemByIndex deletes the spectrum addressed by the parameter ItemIdx. Please note that the item index is 0-based (valid range: 0..NSpectra-1). If ItemIdx points to a non-existent spectrum the method does nothing.

The function returns the following error codes:

 0 ... everything is OK, the spectrum has been removed
-1 ... ItemIdx is invalid

Hint: In order to access the spectral collection currently loaded in the Spectral Collection Editor you can use the pre-declared global variable SCData.