Q32274: Do Not Use DOS Interrupts to Terminate Compiled Programs
Article: Q32274 Product(s): See article Version(s): 4.00 4.00b 4.50 Operating System(s): MS-DOS Keyword(s): ENDUSER | B_BasicCom | mspl13_basic Last Modified: 21-DEC-1989 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, "Terminate With Return Code" (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. 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.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.