Import Arrays Example (VB.NET)
[VB.NET]
' COPYRIGHT(C), SIMPLEXAR SOFTWARE LIMITED, 2006-2008.
' All rights reserved.
'
' Use of this copyright notice is precautionary only, and does not imply
' publication or disclosure. The content of this work contains confidential
' and proprietary information of Simplexar Software Limited. Any duplication,
' modification, distribution, or disclosure in any form, in whole, or in part,
' is strictly prohibited without express prior written permission.
' Get namespaces.
Imports System
Imports Simplexar.Statsar
' Start namespace.
Namespace Simplexar.Examples.Statsar
' This example shows how to import data from different types of arrays
' including one-dimensional arrays, multidimensional arrays and jagged
' arrays.
Module Example
' The application entry point.
Public Sub Main()
Try
RunExample()
Catch exception As Exception
Console.WriteLine(exception)
End Try
Console.WriteLine("Press ENTER to terminate.")
Console.ReadLine()
End Sub
Private Sub RunExample()
' Create a calculator.
Dim calculator As New StatsCalculator()
' Load a one-dimensional array.
Dim sheet1 As DataSheet = calculator.Load( _
New Double() {44.5, -23.3, 15.67})
Console.WriteLine(sheet1)
' Load a multidimensional array.
Dim multiArray As Double(,) _
= {{-1, 3.4}, {7.8, 1.2}, {2.6, 9.4}}
Dim sheet2 As DataSheet = calculator.Load(multiArray)
Console.WriteLine(sheet2)
' Load a jagged array.
Dim jaggedArray As Double()() = { _
New Double() {2.1, 6.4}, New Double() {8.8, 1.9}, _
New Double() {3.7, 5.2}}
Dim sheet3 As DataSheet = calculator.Load(jaggedArray)
Console.WriteLine(sheet3)
End Sub
End Module
End Namespace