Need help porting function to Free Pascal

Jeff Patterson skrev i meddelandet ...

Quote

>How can I get this function I wrote in TP7 to work in Free Pascal?    I
>know that the Mem[] is referencing Real-Mode memory, but i want it to
>reference the variable I am trying to reference with Seg(),Ofs() (which
>of course don't work with FPC).

See if you can follow this: (I changed quite a lot...)

function Stz(var Start; max:Byte):String;
var S : String;
    SLen : Byte Absolute S;
    St : Array[Byte] of Char Absolute Start;   {-- Here's the magic! --}
begin
  If Max = 0 then Max := 1;
  SLen:=0;
  while (SLen<Max) and not (St [SLen] in [#0,#26]) do Begin
      S [ Succ(SLen) ] := St [SLen];
      Inc(SLen);
  End;
  Stz := S;
end;

--
/GreenGhost
________________________
Kill the spammer to mail me