Microsoft KB Archive/39251

= Microsoft Knowledge Base =

NOCOM.OBJ Supplement for QuickBasic 4.50 for Smaller .EXE
Last reviewed: September 25, 1997

Article ID: Q39251

4.50 MS-DOS kbprg kbfile kbdocerr

SUMMARY
On pages 349 and 357 of the &quot;Microsoft QuickBasic 4.5: Programming in Basic&quot; manual for version 4.50, the NOTE on the bottom of the page incorrectly states that NOCOM.OBJ is shipped with QuickBasic version 4.50.

To get NOCOM.OBJ for QuickBasic version 4.50:

You can find NOCOM450.EXE, a self-extracting file, on these services:

  Microsoft's World Wide Web site on the Internet On the www.microsoft.com home page, click the Support icon Click Knowledge Base, and select the product Enter kbfile NOCOM450.EXE, and click GO! Open the article, and click the button to download the file   Internet (anonymous FTP) ftp ftp.microsoft.com Change to the Softlib/Mslfiles folder Get NOCOM450.EXE   The Microsoft Network On the Edit menu, click Go To, and then click Other Location Type &quot;mssupport&quot; (without the quotation marks) Double-click the MS Software Library icon Find the appropriate product area Locate and Download NOCOM450.EXE   Microsoft Download Service (MSDL) Dial (425) 936-6735 to connect to MSDL Download NOCOM450.EXE 

For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

ARTICLE-ID: Q119591 TITLE    : How to Obtain Microsoft Support Files from Online Services For standalone .EXE files (that is, those compiled with the BC /O option) that use a string variable for the filename in the OPEN statement, linking to the file NOCOM.OBJ reduces the size of the programs by about 4K. NOCOM can be used only with programs that do NOT use serial communications.

MORE INFORMATION
The NOCOM.OBJ file was shipped with Microsoft Basic Compiler versions 6.00 and 6.00b; with Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10; and with QuickBasic versions 4.00 and 4.00b, but not with QuickBasic version 4.50 (due to lack of disk space).

The following text is taken from the NOCOM.DOC file in the MSL:

Dear Microsoft Customer,

Please find enclosed a copy of the NOCOM.OBJ file you requested for use with QuickBasic version 4.50. Before using this file, please read the following guidelines that explain when NOCOM is useful.

If your program contains OPEN statements that use a string variable for the filename, the compiler will not recognize that this OPEN statement is not being used for data communications. The following is an example:

a$ = &quot;LPT1:&quot; OPEN a$ FOR OUTPUT AS #1

As a result, the overhead necessary to support data communications will be automatically included in the executable program. In the above example, your EXE file size will be reduced by approximately 4K if you compile with BC /O (stand-alone option) and link using the following LINK command:

BC yourprog.BAS/O; LINK yourprog.OBJ+NOCOM.OBJ;

However, if your program does not contain any OPEN statements, or  if the OPEN statements do not contain string variables as shown in   the above example, the compiler will recognize that the program does not contain any data communications routines. Subsequently, none of the data communications support will be automatically attached to the program. In most cases, you do not need to link to  the file NOCOM.OBJ.

Thank you

Microsoft Technical Support