Sign in Join
FPDoc Onlineexperiment

TCustomBufDataset.LoadFromStream procedure

Member of TCustomBufDatasetpublicIn unit BufDataset

Loads the dataset from the specified stream using the given data format.

Declaration

pascal
procedure LoadFromStream(AStream: TStream; 
 Format: TDataPacketFormat=dfDefault)

Arguments

AStream

Stream with values loaded into the dataset.

Format

Format expected in the stream.

Description

LoadFromStream is a procedure used to load field definitions and record data for the dataset from the specified stream. LoadFromStream is an overloaded variant of the method defined in the ancestor class and includes a parameter for the desired data packet format.

AStream is a TStream descendant with the values to load in the dataset. Format indicates the expected format for data packets in the stream. It is a variable argument that can be modified when a packet reader is located for the stream.

LoadFromStream calls CheckBiDirectional to ensure that the UniDirectional property in the dataset is set to False. An exception is raised when UniDirectional contains True. Index creation requires navigating in a non-default record order that would not be supported in a uni-directional dataset.

LoadFromStream creates a temporary TDataPacketReader class instance using the value specified in the Format argument. Format is a variable argument and can be modified when SetDatasetPacket is used to examine the packet reader and its stream. Calling SetDatasetPacket sets in motion a relatively complicated sequence of events that eventually get the field definitions and record data loaded into the dataset. The journey starts with Open.

LoadFromStream is used in the implementation of the LoadFromFile method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.