Dominique Louis wrote:
I know I've labeled this as Mac OS X, it's probably not specific to that OS.

I've looked at the scanline demo and it works fine on Mac OS X.

My question is when I try to use the code in my project using Delphi compatability mode, I get the error listed below...

var
  lRow : Pointer;
  ScanLineImage : TLazIntfImage;
begin
  for j := 0 to Height - 1 do
  begin
    lRow := ScanLineImage.GetDataLineStart( j );
    i := 0;
    while ( i < Width - 1 ) do
    begin
      PByte(lRow)[i] := 0;  // Error : Array type required
    end;
  end;
end;

Why and is there a fix for this?

in objfpc mode you can access any typed pointer as an array like:

var
  p: PWord;
begin
  ...
  p[someindex] := 12345;


Should I define lRow as a PByteArray?

In delphi mode, Yes.

Unless you want to compile this in Delphi, there is no reason to use delphi mode. You can, if needed, use a different mode per unit.

Marc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to