Microsoft KB Archive/36359

From BetaArchive Wiki
Knowledge Base


How to Load Programs Faster for Compilation in Mac QuickBASIC

Article ID: 36359

Article Last Modified on 11/21/2006

This article was previously published under Q36359

SUMMARY

When you have a program loaded into the Macintosh QuickBASIC environment, it is kept in memory in a compressed (tokenized) format, even when the program is a TEXT file on disk.

A program takes longer to load into the QuickBASIC environment when saved as TEXT because QuickBASIC must convert it into compressed format. In compressed format, the QuickBASIC reserved words have been recognized and converted into special tokens, and numbers have been converted into their internal representation.

When you compile a program that is in memory, BASIC converts the interpreter's compressed format into plain ASCII text a line at a time, passing each line to the compiler. This decompressing process can be slow.

To save a little time when compiling files saved in TEXT format, you can circumvent the initial QuickBASIC environment loading wait as described in methods 1 and 2 below.

MORE INFORMATION

The following are two methods to speed the compiling of large programs in Macintosh QuickBASIC:

  1. If your program does not use '$INCLUDE files (because nesting of '$INCLUDE metacommands is not supported), you can create a dummy source file that contains the following:

       '$INCLUDE "my real program"
                            

    where "my real program" must be saved in TEXT format. You can set the compiler options for the program in the Options... item in the Run menu, and then compile it. This method saves the time it would have taken to initially load the program into the QuickBASIC environment.

  2. Another trick is to write an application that sublaunches QuickBASIC, passing it the name of the file and an Apple Finder message of 256. This method saves the time it would have taken to initially load the program into the QuickBASIC environment and then manually invoke the compiler. The following is an example:

       QBName$="Microsoft QuickBASIC (b)"
       FileName$="my program"
       Sublaunch QBName$, FileName$, 256
                            

    Note that both of these names must be full pathnames or valid for the current directory. If QuickBASIC is in a different folder or has a different name, you may hang the system, thereby forcing a system restart.



Additional query words: MQuickB

Keywords: KB36359