Load

Declaration: TMetaData.Load(FName: string): integer;
Loads the metadata from the file FName. The property DataFName is set accordingly.

The function returns the following error codes:

 0 ... everything's OK
-1 ... wrong or undefined content type
-2 ... invalid property id
-3 ... invalid date time format
-4 ... the specified metadata file does not exist
-5 ... meta data fields are not properly sized (use ResizeContainers prior to calling Load)

Hint: Load assumes that the dimensions of the central data management arrays are already set to the corresponding values (i.e. that the procedure ResizeContainers has been called before). If you do not know the size of the cube in advance you can use ReadMetaHeader to obtain the size of the associated cube (see example below).

Example: The following example shows how to load the meta data without knowing details in advance:
program LoadMetaTest;

var
  Md          : TMetaData;
  FName       : string;
  Version     : integer;
  NCols       : integer;
  NRows       : integer;
  NLayers     : integer;
  NTSlots     : integer;

begin
Md := TMetaData.Create(nil);
FName := SelectFile (GetILabDir(idWork),'*.ilab','Please select a file');
Md.ReadMetaHeader (FName, Version, NCols, NRows, NLayers, NTSlots);
Md.ResizeContainers (NCols, NRows, NLayers, NTSlots);
Md.Load (FName);
Md.Free;
end.