Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!convex!mic!letni!utacfd!merch!cpe!hal6000!tisgate!doug From: doug@tisgate.tis.tandy.com Newsgroups: comp.lang.c Subject: Re: <-25@> Message-ID: <700002@tisgate> Date: 27 Jun 91 17:38:20 GMT References: Lines: 34 Nf-ID: #R::-25:tisgate:700002:000:1347 Nf-From: tisgate.tis.tandy.com!doug Jun 26 17:52:00 1991 /* Written 5:38 pm Jun 26, 1991 by doug@tisgate.tis.tandy.com in tisgate:comp.lang.c */ > /* ---------- "Calling TP functions from TC" ---------- */ > Hi. > I have been told by a few people that it is impossible to call turbo > pascal functions from turbo C, and a few others told me they thought > you could do it, but wasn't sure. > Please help, I'm pretty desperate in this situation, I have little to > no knowledge of pascal, and this is one of those time where I can't > use a pascal to C translator. > If there is a way, does someone know how? > Please help, and any help is GREATLY appreciated!!! You may have figured this out by now but I'll send a message anyway. You can simply declare the Pascal functions to be pascal functions. If you have a routine such as procedure foo(a:integer; var b:integer); you could declare it in your C program as extern pascal void foo(int a, int *b); You can also have C function compiled using Pascal style parameter passing by using the -p option. If you have any function in the code that you keep with the C style parameter passing then use the keyword 'cdelc' in the function declaration. Notice that if you declare a function to be a pascal routine then you cannot pass a variable number of parameters to it as you can in C. Doug Scott