[fpc-pascal] How to pass an array of bytes directly in a TBytes param?

silvioprog silvioprog at gmail.com
Sat Feb 20 01:44:29 CET 2016


Hello,

Consider the following procedure:

procedure test(b: TBytes);
begin
end;

The common way to pass an array of bytes in this procedure is declaring and
initializing a TBytes variable. But in Delphi (XE) I just do:

  test([65, 66, 67]);

However, when I try it on FPC (trunk), I get:

"Error: Incompatible type for arg no. 1: Got "{Array Of Const/Constant
Open} Array of ShortInt", expected "TBytes"".

Is this feature supported in FPC? If so, how to use that?!

Thank you!

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160219/532ccdb6/attachment.html>


More information about the fpc-pascal mailing list