KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q28588: Pascal Subprogram "Invalid Format" Loaded as Quick Library

Article: Q28588
Product(s): See article
Version(s): 4.00 4.00b
Operating System(s): MS-DOS
Keyword(s): ENDUSER | B_BasicCom buglist4.00 buglist4.00b fixlist4.50 | mspl13_basic
Last Modified: 17-APR-1990

A Pascal subprogram that receives single- or double-precision numbers
as parameters cannot be made into a Quick library. QuickBASIC gives an
"invalid format" error when the Quick library is specified during the
invocation of the QB editor (QB /L pascsub.QLB). This error does not
occur if using a Pascal function instead of a Pascal subprogram.

The same subprogram can be linked to a QuickBASIC main module and the
resulting EXE file runs without any problems.

Microsoft has confirmed this to be a problem in QuickBASIC Versions
4.00 and 4.00b and in the Microsoft BASIC Compiler Version 6.00 for
MS-DOS and OS/2 (buglist6.00). This problem was corrected in
QuickBASIC Version 4.50.

Results of testing with previous versions indicate the same problem
occurs with the release of QuickBASIC provided with the BASIC Compiler
Version 6.00 for MS-DOS and OS/2.

As a workaround, link the modules together instead of running in the
QB.EXE editor.

The following is sample code of the QuickBASIC main program (however,
it never gets this far):

DECLARE SUB PasSub (i!)    'Or i# gives the same results.
i! = 100000
CALL PasSub(i!)
print i!

The following is sample code for the the Pascal subprogram. There is
a problem with both real4 (single) and real8 (double):

    module Pstuff;
     procedure PasSub(var b:real4);
       begin
         b := b + 1;
       end; {PasSub}
    end.

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.