Chapter 12


Home

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Chapter 11

Chapter 12

Chapter 13

Chapter 14

Chapter 15

Table of Contents


User-Defined Types and File System Controls

The greatest common factor (gcf) is the largest number that divides evenly into two given numbers. The gcf of 12 and 16 is 4. You can find the gcf of very large numbers quickly with the Euclidean algorithm.

The code module is a collection of type definitions, variable declarations, and procedure definitions (both sub and fuction procedures) that are available to every form in a project.

Value parameters are values sent to subprograms without reference to the actual address of the value can be changed within the subprogram without affecting the value of the variable in the calling program.

When parameters are sent by reference to a subprogram, the subprogram is give the address of the value being sent. Because the subprogram knows the real location of the variable in memory, it can make changes to the value of the variable.

Parameters sent by value to a Visual Basic subprogram must be of the built-in Visual Basic types. A user-defined type may not be sent as a value parameter.

There are two ways to call a procedure:

  • Subtract a, b, rslt
  • Call subtract(a, b, Rslt)

    When command buttons are given the same name, they form a control array. The first button is assigned an index value of 0 and the second a value of 1. Subsequent buttons added to the array receive successive index values.

    The Hide and Show methods deactivate and activate forms in your project.

    A listbox uses ListIndex property indicating a selected entry in a listbox.

    The Asc() function and the Chr$() functions are inverse functions. The first converts a character to its ASCII code. The second converts an ASCII code to its corresponding character.

    The drive box allows the usert to choose from a listing of active drives. The drive name is available at run-time in the Drive property.

    The Change event is often used to transfer drive information from the Drive property of the drive box to the Path property of the directiory box.

    The The directory box lists the directories of the drive specified in its run-time only Path property. The value of the Path property is changed by double-clicking an entry in the window. This path information is often written using a Change event procedure to the Path property of a file box.

    The file box displays the files listed in the directory written into the Path property of the box