[bat at niipmm.tsu.ru: Questions about GNU Pascal]

Prof Abimbola Olowofoyeku African_Chief at bigfoot.com
Sat Aug 17 08:57:20 CEST 2002


On 16 Aug 2002 at 5:49, Dieter Schmitz wrote:

> ----- Forwarded message from "Alexei P. Baturin" <bat at niipmm.tsu.ru>
> -----
> 
> From: "Alexei P. Baturin" <bat at niipmm.tsu.ru>
> To: <gpc-owner at gnu.de>
> Subject: Questions about  GNU Pascal
> Date: Thu, 15 Aug 2002 16:49:39 +0700
> 
> Good day,
>  Would you like to answer two questions about GNU Pascal (MS DOS with
>  DGJPP) for which I haven't found the answer in documentation? I work in
>  MS-DOS  under Windows 98 (processor Pentium II). 
> 
>  1. Is it possible to force the functions sin, cos, exp, ln, **, etc. to
>  calculate a result of type LongReal (10 bytes) with a precision of 19
>  decimal digits (as in BP or Delphi)? 

Dunno. But I would be surprised if it wasn't.
 
>  2. How to use DLL's in GP-programs? I tried to import a function
>  from DLL by usual way (as in Delphi):
>
>  function esin(x:extended):extended; external 'extenlib.dll' index 1;
> 
>  but the compiler didn't understand this. Can you help me to solve
>  this problem?

It's not so straightforward. You need to have an import library for 
your dll (e.g., libmydll.a) that you would link. Otherwise, (under 
Windows) you could always use LoadLibrary and GetProcAddress.

With regard to the syntax, under Windows, you would do something like:
function esin(x:extended):extended; asmname 'esin'; attribute(stdcall);
I have no idea what you would do under djgpp.

Best regards, The Chief
--------
Prof. Abimbola A. Olowofoyeku (The African Chief) 
web:  http://www.bigfoot.com/~African_Chief
email: African_Chief at bigfoot.com




More information about the Gpc mailing list