Hello!

I simplified my email, but this is how it is actually being done :(

Aitor


On Mon, 7 Nov 2022 at 14:38, stefano cirilli <stefanociri...@tim.it> wrote:

> Hi, try to define the variable as a Type:
>
> I googled this:
> Type TOneArg = Procedure (Var X : integer); on
> https://www.freepascal.org/docs-html/ref/refse17.html
> On 07/11/22 01:18, Aitor Santamaría wrote:
>
> Hello,
>
> I am trying to recompile FD-KEYB using 16-bit DOS FreePascal, in order to
> see if I can produce a FPC version and thus avoid using TPC for compiling.
>
> I am not being very lucky with compiling itself, and I haven't raised too
> much attention in the FPC lists, either because it is difficult, or most
> probably, compiling for an old 16-bit OS does not raise too much interest.
>
> So I am trying this list here, in case some of you have ever mangled
> 16-bit FPC and know the answer.
>
> The biggest problem I am having is with the procedural type variables.
> Whereas TPC would swallow this:
>
> VAR
>    v: procedure;
>
> procedure P;
> begin
> ...
> end;
>
> v := P;
>
> FPC does not like it, as it is trying to assign the RESULT of P (untyped)
> to v.
>
> KEYB.PAS(2960,21) Error: Incompatible types: got "untyped" expected
> "<procedure variable type of procedure;Pascal>"
>
> The documentation tells me to use
>
> v := @P;
>
> but it does not work, it gives:
>
> KEYB.PAS(2960,21) Error: Illegal type conversion: "<address of
> procedure;far;Pascal>" to "<procedure variable type of procedure;Pascal>"
>
> which puzzles me, because to my  mind, they are the same thing.
>
>
> Using -MTP compiler option does not help, I get lots of new errors, unless
> I avoid it by
>
> TYPE
>         SimpleProc     = procedure; far;     { parameter-less callable
> function }
>
> (which is NOT standard TP language at all), but would in turn give me:
>
> KEYB.PAS(2960,21) Error: Illegal type conversion: "<address of
> procedure;far;Pascal>" to "NearCsPointer"
>
> You can read the full thread here:
> Far pointer versus Pointer in 16-bit DOS (freepascal.org)
> <https://forum.lazarus.freepascal.org/index.php/topic,60973.0.html>
>
>
> Any hints on how to circumvent this problem?
>
> Thanks in advance,
> Aitor
>
>
>
>
> _______________________________________________
> Freedos-devel mailing 
> listFreedos-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/freedos-devel
>
> _______________________________________________
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel
>
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to