·  VB – Syntax – Procedures

 

- Info:

  - Sub procedure is a section of code that doesn't give back a result.

  - When defining input parameters you don't need to define types.

  - Sub procedure that is written in the module of a form has direct access to the controls that belong to the form.

 

- Procedure:

  - Create VB Application Test.vb

 

    Test.vb

    Sub Main()

    

      Call NoParameters

           NoParameters

    

      Call Parameters(10, 2)

      Call Parameters(10, _

                       2)

      

    End Sub

    

    Sub NoParameters()

      MsgBox ("This subroutine expects no input parameters.")

    End Sub

    

    Sub Parameters(p1 As Integer, p2)

      MsgBox (p1 / p2)

    End Sub