Summary

Value method allows to serialize typed data value. Both, simple types, such as Integer or string, and complex types, such as records, objects or arrays can be serialized using Value method.

Syntax

procedure Value<T>(const V: T);

Type Parameters

T
Specifies type of serializing value.

Parameters

V

Type: T

Specifies value to serialize.

Remarks

Value method should be used to serialize typed data values. It can be called in the following serializer states:

The algorithm, which is used to serialize typed values, depends of its type. Serialization engine provides built-in support for many Delphi types. For example, an array is serialized by writing all its elements; record or object is serialized by writing all its public fields and properties. There are two possible ways to change the way in which values of some type are serialized:

Examples

DelphiCopyCode imageCopy Code
S.Value<string>('Some string');
S.Value<Integer>(7);
S.Value<TMyCustomer>(customer);