Wolfebohne's QB page

Links QB Files QB Modules Forum FAQ

Modular programming.

The idea behing modular programming is so the programmer does not have to keep "re-inventing" the wheel. The programmer will write a set of code that is generic enough to be used in many different applications.

Most people know that any operating system is composed of more than one file. It is actually several hundred files, most of these being pieces of code that other programs need in order to function.

By breaking the code into smaller pieces, the result is a smaller application and debugging is much more efficient. The way to do this in QuickBASIC is to perform the following:

  1. Create a new program.
  2. Create a subroutine, let's say 'PrintName()', and insert the code between the SUB...END SUB lines: PRINT "My Name is:"
  3. Save the file as 'MyName.BAS'.
  4. Create a new file.
  5. Using the menu, do 'File>Load Program'. Then find the file 'MyName.BAS' and load it.
  6. From the new program, call the procedure; CALL PrintName
  7. Run the program.
  8. When the program stops, press 'F2' to see the 2 modules and 1 sub procedure.

When you download my programs, be sure to always have the DIALOG.BAS and DIALOG.BI in the same directory, or they won't work. I do this so I can enhance code in only one file, and it affects all the others.

Download QBASIC
Version 1.0

Version 3.0

Version 4.5
Hosted by www.Geocities.ws

1