Re: [Lazarus] Pointer woes when trying to port a Delphi program

2012-08-25 Thread Bernd
2012/8/24 brian : > Buttons[1]^ := FirstButton; It is crashing because here you are dereferencing an uninitialized pointer Button[1] does not contain any reasonable value at this moment, Button[1]^ therefore points to some random location and Buton[1]^:= is trying to write something to that rand

Re: [Lazarus] Pointer woes when trying to port a Delphi program

2012-08-24 Thread Juha Manninen
On Fri, Aug 24, 2012 at 10:22 PM, brian wrote: > Type > TBtnPtr = ^TButton; > TBtnArray = Array [1..36] of TBtnPtr; > TButton is a reference type. Reference is basically a pointer which does not require the pointer syntax. You are really defining a pointer to pointer, a useless indirection the

Re: [Lazarus] Pointer woes when trying to port a Delphi program

2012-08-24 Thread ik
On Fri, Aug 24, 2012 at 10:22 PM, brian wrote: > Hi all, > > I'm trying to port a Delphi program to Lazarus, although I'm redoing the > interface from scratch. > > Without getting into to much detail about what the program does, it needs > an array of 72 buttons on the main screen, these buttons

[Lazarus] Pointer woes when trying to port a Delphi program

2012-08-24 Thread brian
Hi all, I'm trying to port a Delphi program to Lazarus, although I'm redoing the interface from scratch. Without getting into to much detail about what the program does, it needs an array of 72 buttons on the main screen, these buttons have their captions changed and are variously enabled an