ITabRange.ParseValue

Syntax

ParseValue(Value: String);

Parameters

Value. The value to be transformed.

Description

The ParseValue method transforms the value from the string passed by the value parameter in accordance with the value type and sets this value for the range.

Comments

When this method is invoked the system automatically identifies the type of the value passed in the Value character string. The cells of the range are immediately formatted in accordance with the value type. The cell editor includes a calendar for the values of the date type.

Example

Executing the example requires a form with the Button1 button located on it, the TabSheetBox component and the UiTabSheet component named UiTabSheet1. UiTabSheet1 is selected as the data source for the TabSheetBox component.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        TSheet: ITabSheet;
        r, r1, r2, r3: ITabRange;
    Begin
        TSheet := UiTabSheet1.TabSheet;
        r := TSheet.Cell(00);
        r1 := TSheet.Cell(01);
        r2 := TSheet.Cell(02);
        r3 := TSheet.Cell(03);
        //Set values using ParseValue method
        r.ParseValue("100");
        Debug.WriteLine(r.Value.VarType);
        r1.ParseValue("01.01.2001");
        Debug.WriteLine(r1.Value.VarType);
        //Set values using  Value property
        r2.Value := "100";
        Debug.WriteLine(r2.Value.VarType);
        r3.Value := "01.01.2001";
        Debug.WriteLine(r3.Value.VarType);
    End Sub Button1OnClick;

When this example is executed the values of the cells in A0:D0 range are set using various methods. Types of the data that have some values in the cells are to be displayed in the console of the development environment.

See also:

ITabRange