On Tue, Jan 19, 2010 at 20:14, Roland Turcan <[email protected]> wrote: > Hello all, > > I use Delphi style of programing in Lazarus to keep a compatibility > with Kylix and therefore I want to get this code which is valid of > Freepascal's ObjectPascal, but in {$MODE Delphi} it doesn't accept > calling of "MyItems[index]" and writes "Array type required". > > How to adapt this code to be valid for Delphi mode. > > TYPE > PtrUInt = DWord; > TMyObj = PtrUInt; > PMyObj = ^TMyObj; > TArr = ARRAY OF TMyObj; > > procedure TForm1.FormCreate(Sender: TObject); > VAR MyItems :PMyObj; [skip] > > ShowMessage (IntToStr (MyItems[0])); > end;
This should not compile, since pointer is not an array in Pascal. Delphi does not accept this code too. -- Alexander S. Klenin -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
