System.Classes.TReader.ReadVariant
Delphi
function ReadVariant: Variant;
C++
System::Variant __fastcall ReadVariant();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TReader |
Description
Reads and returns a Variant type value from the reader object's stream.
ReadVariant is a helper method used by other reader methods to read a tagged Variant type value at the current reader Position.
ReadVariant calls NextValue to read the value-type indicator. If the retrieved value-type indicator is:
vaNull
-- ReadVariant returns the Null value.vaFalse
-- ReadVariant returnsFalse
.vaTrue
-- ReadVariant returnsTrue
.vaInt8
-- ReadVariant calls ReadInteger to read an Int8 type integer value at the current reader Position and returns the obtained value as a Shortint type value.vaInt16
-- ReadVariant calls ReadInteger to read an Int16 type integer value at the current reader Position and returns the obtained value as a Smallint type value.vaInt32
-- ReadVariant calls ReadInteger to read an Int32 type integer value at the current reader Position and returns the obtained value as an Integer type value.vaInt64
-- ReadVariant calls ReadInt64 to read an Int64 type integer value at the current reader Position and returns the obtained value as an Int64 type value.vaExtended
-- ReadVariant calls ReadFloat to read an Extended type floating-point value at the current reader Position and returns the obtained value.vaSingle
-- ReadVariant calls ReadSingle to read a Single floating-point value at the current reader Position and returns the obtained value.vaDouble
-- ReadVariant calls ReadDouble to read a Double floating-point data value at the current reader Position and returns the obtained value.vaCurrency
-- ReadVariant calls ReadCurrency to read a Currency type value at the current reader Position and returns the obtained value.vaDate
-- ReadVariant calls ReadDate to read a TDateTime type value at the current reader Position and returns the obtained value.vaString
,vaLString
,vaWString
, orvaUTF8String
-- ReadVariant calls ReadString to read a string type value at the current reader Position and returns the obtained value in the String type.vaBinary
-- ReadVariant calls Read to read a value at the current reader Position and returns the obtained value.- Otherwise, ReadVariant raises an EReadError exception.
ReadVariant advances the reader Position after the last byte it has read.