ITabRange.ToDouble2DArray

Syntax

ToDouble2DArray(Var NonDoublesExist: Boolean): Array;

Parameters

NonDoublesExist. Indicates whether array has non-real values.

Description

The ToDouble2DArray method transforms range into two dimensional array of real numbers.

Comments

After executing the method, the NonDoublesExist parameter has the following value:

If the ITabErrorCheckingOptions.EnableChecking property is set to True, on calling the ToDouble2DArray method all options from ITabSheet.ErrorCheckingOptions are taken into account.

Example

Executing the example requires a form that contains the Button component with the Button identifier, the TabSheetBox component with the TabSheetBox1 identifier and the UiTabSheet component with the UiTabSheet1 identifier. Set the UiTabSheet1 component as a data source for the TabSheetBox1 component.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    TSheet: ITabSheet;
    TRange: ITabRange;
    Arr: Array Of Double;
    NonDoubleExist: Boolean;
Begin
    TSheet := UiTabSheet1.TabSheet;
    TRange := TSheet.View.Selection.Range;
    Arr := TRange.ToDouble2DArray(NonDoubleExist);
    If NonDoubleExist Then
        Debug.WriteLine("The array has non-real values");
        Else 
            Debug.WriteLine("The array has only  real values");
    End If;
End Sub Button1OnClick;

Clicking the button creates the Arr real array where values of the selected table range are placed. The console window displays the message that the Arr array has non-real values..

See also:

ITabRange