Module Statement

This statement begins a user-defined module section. All variable definitions and procedures must be inside a Module or Class definition.

Modulemodule_name

Prerequisites

Modules can only be declared at the top-level of a file.

Parameters

module_name

The name of module that is being started.

Remarks

A Module must always end with an End Module statement. A Module contains variable, procedures or class definitions. There can be multiple modules defined in a single file. All variables, procedures and classes defined within a module can be accessed anywhere in that module. Only Public variables, procedures and classes can be accessed outside the module.

Examples

Module main_module
Public Dim Start As Location ' All modules can access Start
Private Dim x1 As Location ' Only this module can access x1
' All modules can access add_function

Public Function add_function (x As Integer,y As Integer) As Integer
add_function = x+y
End Function
End Module

See Also

Statements | Class Statement | Dim Statement| End Module Statement| Function Statement| Sub Statement