Implements an object that can hold any type of value; Integer,
Float, Boolean, Object, etc.; and can convert between them. Since it avoids all pointers to values, There are a few issues:
1. If you use AsInterface, it better well be an interface or
you will get an access error
2. The Precision of Currency is only what will fit in Single
3. AsVariant does not truly store the variant. |
The bulk of the class is just properties and their accessor methods for retrieving values of the different types. The class does not guarantee type conversion between all the types, but the basic conversions have been implemented.
For Windows platforms only.
Note
|
This class is extremely similar to the TIEValue class in the Inference Engine Component Suite, but without the IECS specific code.
|
Namespace: GValue
Delphi
|
type
TGCustomValue = class
end;
|
|
Name
|
Description
|
|
AsBoolean
|
Allows the user to get and set the value inside the object as a boolean. When you assign a value using the AsBoolean property, the VType property is changed to vtBoolean.
|
|
AsChar
|
Allows the user to get and set the value inside the object as a character. When you assign a value using the AsChar property, the VType property is changed to vtChar.
|
|
AsClass
|
Allows the user to get and set the value inside the object as a class. When you assign a value using the AsClass property, the VType property is changed to vtClass.
|
|
AsCurrency
|
Allows the user to get and set the value inside the object as a currency value. When you assign a value using the AsCurrency property, the VType property is changed to vtCurrency.
|
|
AsFloat
|
Allows the user to get and set the value inside the object as a floating point number. When you assign a value using the AsFloat property, the VType property is changed to vtFloat.
|
|
AsInteger
|
Allows the user to get and set the value inside the object as an integer. When you assign a value using the AsInteger property, the VType property is changed to vtInteger.
|
|
AsInterface
|
Allows the user to get and set the value inside the object as an interface. When you assign a value using the AsInterface property, the VType property is changed to vtInterface.
|
|
AsObject
|
Allows the user to get and set the value inside the object as an object. When you assign a value using the AsObject property, the VType property is changed to vtObject.
|
|
AsPChar
|
Allows the user to get and set the value inside the object as a pointer to a character. When you assign a value using the AsPChar property, the VType property is changed to vtPChar.
|
|
AsPointer
|
Allows the user to get and set the value inside the object as a pointer. When you assign a value using the AsPointer property, the VType property is changed to vtPointer.
|
|
AsString
|
Allows the user to get and set the value inside the object as a string. When you assign a value using the AsString property, the VType property is changed to vtString.
|
|
AsVariant
|
Allows the user to get and set the value inside the object as a variant. When you assign a value using the AsVariant property, the VType property is changed to vtVariant.
|
|
AsWideString
|
Allows the user to get and set the value inside the object as a wide string. When you assign a value using the AsWideString property, the VType property is changed to vtWideString.
|
|
Unassigned
|
Returns true if a value has not been assigned to the object through an AsXXX property assignment.
|
|
Value
|
Stores the value in the object
|
|
VType
|
Returns the type of the value in the object.
VType is set by calling one of the AsXXX methods.
|
Top
|