Forum > General

RTL: export/import WriteLn ?

(1/3) > >>

paule32:
Hello,
how can I export/import WriteLn from a DLL ?

MarkMLl:
You mean export it from the DLL to the main program? You can't, because it's a "special" with an indeterminate number of parameters of indeterminate types.

What are you trying to do (and usual things: what OS, what version FPC and so on).

MarkMLl

cdbc:
Hi
The 'Read(Ln)' and 'Write(Ln)' are fpc 'intrinsics' - to you "Magic"

--- Quote ---how can I export/import WriteLn from a DLL ?
--- End quote ---
IMHO the closest you can come, is to emulate them with 'Args: array of const'.
Regards Benny

paule32:
@Mark
I try to implement a own RTL with Classes, not only Functions/functional programming...
At least, to save disk space.

Currently, the DLL is 111.000 KB.
Currently, the EXE is   50.000 KB.

With UPX,
the DLL is 42.000 KB.
the EXE is 20.000 KB.

All rounded Values, to simplyfied the demonstration there.

MarkMLl:
Right, so for the moment at least the OS etc. doesn't matter.

You can't describe Write(), WriteLn(), Read() and ReadLn() from J&W Pascal as standard functions, because (as CDBC says) they require compiler "magic" to handle their parameters both because of the imprecise number/types and the : suffix used to indicate precision (which also obviously affects Str() in later implementations).

All highly regrettable, but as I've previously said Pascal was a rush job to preempt ALGOL-68.

Format() in Object Pascal has similar vagueness in the type of the parameters, but at least that requires that they are specified as an uncounted list and specifies the precision in an FORTRAN/ALGOL/C-style format string.

I suspect that System (as distinct from the remainder of the RTL) can't be linked dynamically, but it would be interesting to see what Sven (or another local compiler guru) has to say about it.

MarkMLl

Navigation

[0] Message Index

[#] Next page

Go to full version