Module

You design a VB .NET module using a class with the <<Module>> stereotype and attributes, functions, subs and events.

In the following example, you define a module Test using a class with the <<Module>> stereotype. Test contains a function. To design this function you have to create an operation called Main and empty the return type property. You can then define the function body in the implementation tab of this operation.



...
Public Module Test
  Public Sub Main()
   Dim val1 As Integer = 0
     Dim val1 As Integer = val1
     val2 = 123
     Dim ref1 As New Class1 ()
     Dim ref1 As Class1 = ref1
     ref2.Value = 123
     Console.WriteLine ("Value: "& val1", "& val2)
     Console.WriteLine ("Refs: "&ref1.Value &", "& ref2.Value)
   
  End Sub
 End Module
...