Microsoft KB Archive/32274

= Do Not Use DOS Interrupts to Terminate Compiled Programs =

Article ID: 32274

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q32274



SUMMARY
The following information applies to QuickBasic Versions 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.

Some DOS interrupts should not be invoked from QuickBasic programs. For example, &quot;Terminate With Return Code&quot; (Interrupt 21H, function 4CH) can cause loss of the cursor the first time it is executed, then a hard hang on a subsequent CALL.

QuickBasic must control its own termination to correctly return to DOS. Please use the END statement in Basic rather than a DOS interrupt to terminate a program.



MORE INFORMATION
The following is a code example: 'WARNING: 'Execution of the following code will result in unpredictable results, 'such as system lockup or loss of the DOS cursor in some instances. DIM inarray%(7), outarray%(7) inarray%(0) = &H4C00 CALL int86old(&H21, inarray%, outarray%) 'The INT86OLD routine is located in QB.QLB and QB.LIB.

Additional query words: QuickBas BasicCom

Keywords: KB32274

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.