Linking TC routines

 BBS: Inland Empire Archive
Date: 09-19-92 (18:32)             Number: 360
From: BOB PERKINS                  Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Linking TC routines            Conf: (2) Quik_Bas
  Someone was asking the other day if TurboC routines could
be linked into QB.  Although this was done with v1.5 of
TurboC, it ought to work with newer versions.  I picked a
real simple function that just returns the state of the DOS
verify flag.

  First, the C routine:

  #include "dos.h"
  int verify ()
  {
   return getverify();
   }

  Of course the above was compiled with the medium memory
model to be compatible with QB.

  The BASIC source:

  DECLARE FUNCTION verify% CDECL ()
  PRINT "Status of the dos verify flag is "; verify%

  When link asked for the library name, I fed it cm.lib
which is the medium memory model lib for TC.  Works fine.
Since I'm not passing any arguments, the CDECL may not be
required in this example.

--- Msg V4.5
 * Origin: Reciprocity Failure  (1:124/4115.236)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET