[Lazarus] Passing an array to a function

Darmawan Sugiarto darmawan_sugiarto at yahoo.com
Tue Jan 20 09:32:26 CET 2009


Congratulation, so this case was closed

=============INTOSOFT============

           ALEXIO CHAOS

   Darmawan_Sugiarto at yahoo.com   

          Yahoo Messager

=================================

--- On Mon, 1/19/09, Dave Coventry <dgcoventry at gmail.com> wrote:

From: Dave Coventry <dgcoventry at gmail.com>
Subject: Re: [Lazarus] Passing an array to a function
To: "General mailing list" <lazarus at lazarus.freepascal.org>
Date: Monday, January 19, 2009, 9:34 PM

2009/1/20 Darmawan Sugiarto <darmawan_sugiarto at yahoo.com>:
> Can you give more information about your function.

Sure:


function FieldValueAsString(var fsbuffer: TByteBuffer;
fitype,marker,fisize: integer): string;
begin
  case fitype of
43,52,108:Result:=inttostr(LEtoN(PLongint(@fsbuffer[marker])^));
 50:Result:=inttostr(LEtoN(PSmallInt(@fsbuffer[marker])^));
end;
end;

It was failing before it got there, so I don't think the problem was
with the function.

In any case, Martin's suggestion regarding calling the ReadBuffer
function with the first element of the array rather than the pointer
has worked...
_______________________________________________
Lazarus mailing list
Lazarus at lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20090120/bf0a26c7/attachment-0007.html>


More information about the Lazarus mailing list