709-218-7927

The Landfall Garden House

60 Canon Bayley Road

Bonavista, Newfoundland

CANADA A0C 1B0

CPRGreaves@gmail.com

Home

Christopher Greaves

A Bit of Terminology:

Templates

A template is a file, such as Normal.dot, Utils.dot. A template holds a project. Although the two terms may appear synonymous and confusing, this need not be so. I think of it as a Template when I am looking outwards at the hard drive through Windows Explorer. It think of it as a project when I am looking inwards through the VBE.

Projects

A project is held in a file, and consists of one or more Modules.

Modules

A User Module is a part of a template. A user Module holds procedures.

A Form Module is a part of a template. A form Module holds procedures and the graphical representation of the user form.

A Class Module is a part of a template. A class Module holds procedures which define class objects.

Procedures

A procedure lives in a module. A procedure is a block of code with a name. The name is declared with either a Function or a Sub keyword, and a procedure ends with a corresponding End Function or End Sub.

Functions

A Function is a procedure that can return a result by virtue of its name.

A Function may have none, one or more variable parameters.

I find Functions much more useful than subroutines.

Subroutines

A subroutine is a procedure that does not return a result by virtue of its name.

A subroutine may have none, one or more variable parameters.

A subroutine that has no parameters is known as a macro, but is, nonetheless, still a Subroutine procedure.

Macros

A macro is a SUB procedure with no parameters.

A macro can be invoked directly from Word by choosing Tools, Macro, Macros, Run from the menu system, or by a toolbar button, or by a shortcut key. In short, a macro can be invoked directly by your user.

By contrast, a non-macro procedure (a Function, or a Subroutine with arguments) can only be invoked directly by the developer.

709-218-7927 CPRGreaves@gmail.com

Bonavista, Sunday, December 08, 2024 9:31 AM

Copyright © 1990-2024 Chris Greaves. All Rights Reserved.