KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q61674: Machine Hangs When BASIC PDS 7.00 Tries to Call QuickC 2.00

Article: Q61674
Product(s): See article
Version(s): 7.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S900405-131 buglist7.00 S_QuickC | mspl13_basic
Last Modified: 11-MAY-1990

When CALLing Microsoft QuickC version 2.00 from Microsoft BASIC
Professional Development System (PDS) version 7.00, the machine hangs
if a single- or a double-precision number is passed to the C routine
and a comparison of that single- or double-precision number is then
performed in the C routine.

To work around this problem, do one of the following:

1. CALL QuickC from QuickBASIC version 4.50 or from Microsoft BASIC
   Compiler versions 6.00 or 6.00b.

2. Use Microsoft C Compiler version 5.10 instead of QuickC.

3. Pass an integer or a long integer to QuickC instead of the
   floating-point number.

The program below demonstrates the problem.

   Compile and LINK Instructions
   -----------------------------

      BC Basside.bas ;
      QCL /AM /c Cside.c ;
      LINK Basside + Cside,,,BRT70ENR.lib + MLIBCE.LIB ;

   Code Example
   ------------

   ' Here is the BASIC Code

   DECLARE SUB Mycfun CDECL (temp#)

   CLS
   PRINT "On the basic side"
   INPUT "Enter the double precision number "; one#
   CALL Mycfun(one#)
   LOCATE 10, 10
   PRINT "Enter any key to end"
   SLEEP
   CLS
   END

   ' Here is the C code

   #include <c:\qc2\include\stdio.h>

   void Mycfun( double *testdoub)
   {
     printf("I am in the C routine  %lf \n",*testdoub);
    if ((*testdoub) > 2000.0)
     {
        printf ("In the then \n");
     }
     else
     {
        printf("In the else \n");
     };

   printf ("Returning to BASIC \n");

   }

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.