ToDouble2DArray(Var NonDoublesExist: Boolean): Array;
NonDoublesExist. Indicates whether array has non-real values.
The ToDouble2DArray method transforms range into two dimensional array of real numbers.
After executing the method, the NonDoublesExist parameter has the following value:
True if the array has no non-real values.
False if transformed range has non-real values. Instead of the elements with non-real value there is a NaN in the array.
If the ITabErrorCheckingOptions.EnableChecking property is set to True, on calling the ToDouble2DArray method all options from ITabSheet.ErrorCheckingOptions are taken into account.
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: