Declaration: Read4DLayerAndAccumulate(FName: string; Layer, TSlot: integer; var Data: TDouble2DArray): integer;
The function Read4DLayerAndAccumulate reads the layer specified by the parameters Layer and TSlot from the binary file FName and adds the data to the array Data.

The function returns the following error codes:

 0 ... everything is OK
-1 ... Layer out of range
-2 ... TimeSlot out of range
-3 ... the size of the array Data does not match the data cube

Hint 1: The file specified by FName must comply with the binary file format used by SaveBinary, otherwise the routine may result in access violations or otherwise misleading results.

Hint 2: Please note that this routine accesses the binary data cube directly, thus the filename must contain the full path of the corresponding '.cube' file (and not the '.ilab' file, as it would be the case for normal access).