tutorial

Page 216

Imports System Public Module MainModule Sub Main() Dim iOperand1, iOperand2, iResult As Integer iOperand1 = 22 iOperand2 = 11 iResult = 0 Dim objAddClass As New AddClass Dim objSubtractClass As New SubtractClass iResult = objAddClass.Add(iOperand1, iOperand2) Console.WriteLine(iResult.ToString) iResult = objSubtractClass.Subtract(iOperand1, iOperand2) Console.WriteLine(iResult.ToString) Console.ReadLine() End Sub End Module Compiling in VB.NET vbc /r:System.dll MainModule.vb

The code is compiled as follows To create a multi file assemble, which contains the two modules created previously namely AddModule and SubtractModule, compile using the following command at the command prompt Compiling in C# csc /System.dll /addModule:AddModule.netmodule /addModule:SubtractModule.netmodule MainModule.cs Compiling in VB.NET Vbc /System.dll /addModule:AddModule.netmodule /addModule:SubtractModule.netmodule MainModule.vb


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.