Chapter Summary

• Code reuse is implemented as user-defined subprocedures and function procedures.

• Function procedures return a value; subprocedures do not.

• Both subprocedures and function procedures can take one or more arguments.

• Arguments are the data passed into procedures. Parameters are the variables inside the procedure, which represent the argument data.

• Arguments can be passed by value and by reference.

• Arguments passed by value contain a copy of the original data. This prevents the procedure from modifying the original data.

• Arguments passed by reference contain a reference to the variable's memory address. The procedure can modify the original data.

• Arguments are passed by reference automatically.

• Standard modules are used to group commonly referenced user-defined procedures together.

• Arrays are used to store groupings of like data types as one variable.

• An array is a grouping of contiguous memory segments.

• Variables in an array are called elements.

• Each variable in an array shares the same name.

• Elements in an array are accessed via an index.

• VBA arrays are zero based by default.

• Arrays are created just like other variables using the keywords Dim, Static, Public, and Private.

• Two-dimensional arrays are often thought of in terms of a table or matrix.

• Two looping structures (one of which is nested) are required to iterate through each element in a two-dimensional array.

• Dynamic arrays can be created and managed using the ReDim and Preserve keywords.

• Arrays can be passed as arguments to procedures.

• User-defined types are commonly referred to as structures.

• User-defined types are groupings of like information, which can be of different data types.

• User-defined types are created using the Type and End Type statements.

• User-defined types must be declared in a standard module in the general declarations area (outside of any procedure).

• Variables of user-defined type are analogous to rows in a database.

0 0

Post a comment