Table Functions in Visual Basic (

Table Functions of our .NET (dot net) libraries finaquant® protos (non-commercial) or finaquant® calcs (commercial) can be called in other .NET languages including Visual Basic.

The ability to call Table Functions in Visual Basic can make the transition from VBA (Visual Basic for Applications) macros to .net easier for excel user, as the syntax of VBA is similar to syntax of

In order to use Table Functions in Visual Basic, first add a new project of type Visual Basic Console Application in Visual Studio.
Add a new console application project  in Visual Studio

You can now use the Table Functions of finaquant libraries in your code file:

Imports FinaquantCalcs
Module Module1
	Sub Main()
		Dim md As MetaData
		Dim PriceTblFields As TableFields
		Dim PriceTbl As MatrixTable
		' Create meta-data and define fields
	   md = MetaData.CreateEmptyMetaData()
		MetaData.AddNewField(md, "product", FieldType.TextAttribute)
		MetaData.AddNewField(md, "brand", FieldType.TextAttribute)
		MetaData.AddNewField(md, "price", FieldType.KeyFigure)
		' Define table structure for PriceTable
	   PriceTblFields = TableFields.CreateEmptyTableFields(md)
		TableFields.AddNewField(PriceTblFields, "product")
		TableFields.AddNewField(PriceTblFields, "brand")
		TableFields.AddNewField(PriceTblFields, "price")
		' Create PriceTable with elements
	   PriceTbl = MatrixTable.CreateTableWithElements_A(PriceTblFields,
				"car", "Toyota", 1200.0,
				"car", "Honda", 15000.0)
		' View PriceTable
	   MatrixTable.View_MatrixTable(PriceTbl, "Price Table")
	End Sub
End Module
This entry was posted in Calculation engine and tagged , , . Bookmark the permalink.

Leave a Reply