ITabRange.ToDoubleArray

Syntax

ToDoubleArray([SkipNonDoubles: Boolean = false]): Array;

Parameters

SkipNonDoubles. Indicates whether non-integer values must be skipped.

Description

The ToDoubleArray method converts a range into a float array.

Comments

The SkipNonDoubles parameter determines the rule of non-real range values skipping. Available values:

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

Example

Executing the example requires a form that contains the Button component with the Button1 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;
Begin
    TSheet := UiTabSheet1.TabSheet;
    TRange := TSheet.View.Selection.Range;
    Arr := TRange.ToDoubleArray(True);
    // Get array length
    Debug.WriteLine("Array length: " + Arr.Length.ToString);
End Sub Button1OnClick;

Clicking the button creates the Arr real array where values of the selected table range are placed. Non-real values will be ignored. The console displays message about the Arr array length.

See also:

ITabRange