Article ID: 36737 - Last Review: November 21, 2006 - Revision: 1.2 Longer Variable Names Take No Extra Space in .EXE ProgramThis article was previously published under Q36737 SUMMARY
In programs compiled by BC.EXE, you will not change the generated code
size by using shorter variable names instead of longer ones. The
generated .OBJ and .EXE file sizes are independent of the length of
variable names.
Although BC.EXE uses variable names at compile time to allocate memory and translate Basic statements to machine code, these symbolic names are not embedded in the code produced by the compiler. This information applies to Microsoft QuickBasic Versions 1.00, 1.01, 1.02, 2.00, 2.01, 3.00, 4.00, 4.00b, and 4.50; to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2; and to Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2. MORE INFORMATION
Source code can be much more readable if you use fully-descriptive
names in naming variables. QuickBasic allows variable names up to 40
characters in length. Consider the following choices of variable
names:
mfp versus MeanFreePath n$ versus LastName$ vo versus Volts vl versus Volume vc versus Velocity However, within the QB.EXE program development environment, all text in the source file occupies memory, including long variable names. APPLIES TO
| Article Translations
|

Back to the top
