If the code is necessary for the lifetime of the program and is displayed for all the code in the application, then place the function in the standard module.
The standard module stores only one copy of the data. The class module encapsulates data in each instance of the class. That is, for each instance of the class, the data exists separately.
In general, any variables and procedures declared as Public in the standard module are visible anywhere in the project. Variables and procedures declared as Public in the class module can only be visible through a link to an instance of the class module.
The lifetime of the data and procedures stored in the module depends on what type of module is used. The lifetime of the data and procedures in the class module is determined by the lifetime of the object. Thus, data and procedures are available only if there is a reference to the object. The data and procedures announced in the standard modules are available for the life of the program.
Chandralal
source share