Declaration: TMat4D.AppendToBinaryFile (FName: string; TSlotStart, TSlotEnd: integer): integer;
The method AppendToBinaryFile appends selected time slots between TSlotStart and TSlotEnd to the file FName. As a prerequisite, the number of columns, the number of rows, and the number of layers of both the matrix in memory and the matrix on file must be equal; otherwise an exception is raised (cf. the structure of the binary data file).

If any of the time slot parameters are zero or negative, the entire data matrix is appended. If TSlotStart is within the data range but TSlotEnd is beyond the maximum time slot, only the available data are saved.

The function returns the following error codes:

 0 ... everything is OK
-1 ... TSlotStart is beyond the maximum time slot
-2 ... the dimensions of the matrix in the file and the dimensions of the current matrix do not match (NrOfColumns, NrOfRows and NrOfLayers must be the same)