QuickStart 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 loads a simple CSV file from Excel (already included as
' part of the distribution) and computes the average of one of the
' columns.
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()
' Use the calculator to load the sheet.
Dim sheet As DataSheet = calculator.Load( _
"..\..\..\..\..\Data\ExamResults.csv")
' Convert the sheet to a string for display.
Console.WriteLine(sheet.ToString())
' Calculate the mean of the 'EnglishResult' column.
Console.WriteLine(calculator.Mean("EnglishResult"))
End Sub
End Module
End Namespace