Rx Converter

RX Library

RX Converter

UNIT
DataConv

Class
TConverter

This component allows you to access data of any types and convert data between types. TConverter class has properties AsBoolean, AsDate, AsDateTime, AsFloat, AsInteger, AsString and AsTime. Use these properties as appropriate to access or modify the current value stored in TConverter object.


Property AsBoolean
Declaration: AsBoolean: Boolean;

Run-time only. This is a conversion property. AsBoolean can be used to read or set the value as a boolean value (True or False). The DisplayFalse and DisplayTrue properties controls the manner in which boolean values are translated to and from string format by the TConverter component.


Property AsDate
Declaration: AsDate: TDateTime;

Run-time only. This is a conversion property. AsDate can be used to read or set the value stored in the TConverter component as a date value.


Property AsDateTime
Declaration: AsDateTime: TDateTime;

Run-time only. This is a conversion property. AsDateTime can be used to read or set the value stored in the TConverter component as a date-and-time value.


Property AsFloat
Declaration: AsFloat: Double;

Run-time only. This is a conversion property. AsFloat can be used to read or set the value stored in the TConverter component as a Double.


Property AsInteger
Declaration: AsInteger: Longint;

Run-time only. This is a conversion property. AsInteger can be used to read or set the value stored in the TConverter component as an intheger value.


Property AsString
Declaration: AsString: string;

Run-time only. This is a conversion property. AsString can be used to read or set the value stored in the TConverter component as a string value.

When then DataType property is not equal to dtString value and RaiseOnError is True, an exception is raised if TConverter component can't convert a string to the appropriate type.


Property AsTime
Declaration: AsTime: TDateTime;

Run-time only. This is a conversion property. AsTime can be used to read or set the value stored in the TConverter component as a time value.


Property DataType
Declaration: DataType: TDataType;

The DataType identifies the data type of the value stored in the TConverter component.


Property DateTimeFormat
Declaration: DateTimeFormat: TDateTimeFormat;

The value of this property controls the format of date-and-time values when TConverter component converts date-time data to string and backward.


Property Digits
Declaration: Digits: Integer;

Digits is the number of digits that are displayed to the right of the decimal point.


Property DisplayFalse
Declaration: DisplayFalse: string;

The DisplayFalse and DisplayTrue properties controls the manner in which boolean values are translated to and from string format by the TConverter component.


Property DisplayTrue
Declaration: DisplayTrue: string;

The DisplayFalse and DisplayTrue properties controls the manner in which boolean values are translated to and from string format by the TConverter component.


Property FloatFormat
Declaration: FloatFormat: TFloatFormat;

The value of this property controls the format of float values when TConverter component converts float data to string and backward.


Property Precision
Declaration: Precision: Integer;

The Precision property is used in formatting float fields. The value of Precision is the number of decimal places to the right of the decimal point the numeric value should be formatted to before rounding begins. The default value is 15 decimal places.


Property RaiseOnError
Declaration: RaiseOnError: Boolean;

This property determines whether or not an exception is raised when error of type conversion is occured. Default value is True.


Property Text
Declaration: Text: string;

This property can be used to set value stored in the TConverter component as a string value. Available at design-time and at run-time.


Method Clear
Declaration:

procedure Clear;

This method clears the value stored in TConverter component.


Method IsValidChar
Declaration:

function IsValidChar(Ch: Char): Boolean; virtual;

IsValidChar is used by TConverter component to determine if a particular character is valid for the type specified by DataType property.


Class TDateTimeFormat

TDateTimeFormat class used by TConverter component for formatting the date-and-time values.


Property AMString
Declaration: AMString: string;

Character string used to indicate morning (before noon and after midnight) times, when using a twelve-hour clock. Default value is standard TimeAMString constant from SYSUTILS.PAS unit.


Property DateMask
Declaration: DateMask: string;

The DateMask (read-only) property specifies the date output format. The value of this property corresponds to the values of other properties of TDateTimeFormat object.


Property DateOrder
Declaration: DateOrder: TDateOrder;

The DateOrder property controls the order of the month, day, and year components of date. The default is the order normally used in the country selected in the Windows Control Panel.


Property DateSeparator
Declaration: DateSeparator: Char;

The character used to separate the year, month, and day parts of a date value. The initial value is correspond with DateSeparator constant from standard SYSUTILS.PAS module.


Property FourDigitYear
Declaration: FourDigitYear: Boolean;

Specifies the number of digits for the year value (four or two). If True, years are expressed in four digits (i.e., 1997). If False, years have two digits (97).


Property LeadingZero
Declaration: LeadingZero: Boolean;

Specifies whether or not single digit month or day values have a leading zero. For example, if you enter "1/1/80" and this is set to TRUE, TDateTimeFormat interprets the date as "01/1/80." If FALSE, the value is "1/1/80." Default: TRUE.


Property LongDate
Declaration: LongDate: Boolean;

When this property is True, then the full month's names (January-December, using the strings given by the LongMonthNames global variable) are using for output. When False, displays the month as a number (1-12).


Property Mask
Declaration: Mask: string;

The Mask (read-only) property specifies the date-and-time output format. The value of this property corresponds to the values of other properties of TDateTimeFormat object.


Property PMString
Declaration: PMString: string;

Character string used to indicate evening (after noon and before midnight) times, when using a twelve-hour clock. Default value is standard TimePMString constant from SYSUTILS.PAS unit.


Property TimeFormat
Declaration: TimeFormat: TTimeFormat;

The TimeFormat property controls the order and number of digits in the hours, minutes, and seconds components of time.


Property TimeMask
Declaration: TimeMask: string;

The TimeMask (read-only) property specifies the time output format. The value of this property corresponds to the values of other properties of TDateTimeFormat object.

Property TimeSeparator
Declaration: TimeSeparator: Char;

The character used to separate the hour, minute, and second parts of a time value. The initial value is fetched from the TimeSeparator variable in the SYSUTILS.PAS standard unit.


Method ResetDefault
Declaration: procedure ResetDefault; virtual;

ResetDefault clears the values of all properties of TDateTimeFormat object and sets them to its default values. Default values for these properties are depends on Windows settings.


Type TDataType
Declaration: TDataType = (dtString, dtInteger, dtFloat, dtDateTime, dtDate, dtTime, dtBoolean);

TDataType is a set of values for the DataType property of the TConverter component.


Type TTimeFormat
Declaration: TTimeFormat = (tfHHMMSS, tfHMMSS, tfHHMM, tfHMM);

TTimeFormat is a set of values for the TimeFormat property of the TDateTimeFormat class.


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000