<div dir="ltr">On Fri, Aug 24, 2012 at 10:22 PM, brian <span dir="ltr"><<a href="mailto:brian@meadows.pair.com" target="_blank">brian@meadows.pair.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I'm trying to port a Delphi program to Lazarus, although I'm redoing the interface from scratch.<br>
<br>
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 and disabled as the program executes.<br>
<br>
Because of the underlying logic, it's easiest to manipulate these buttons as an array of pointers to the buttons (in fact two arrays, but that's not really relevant).<br>
<br>
So, I have<br>
<br>
Type<br>
TBtnPtr = ^TButton;<br>
TBtnArray = Array [1..36] of TBtnPtr;<br>
<br>
Var<br>
Buttons1, Buttons2 : TBtnArray;<br>
<br>
<br>
Then in a procedure called from the Form's OnCreate, I set the arrays up :-<br>
<br>
Buttons[1]^ := FirstButton;<br>
Buttons[2]^ := SecondButton;<br>
<br>
etc, etc.<br>
<br>
Everything compiles OK, but at runtime, the moment the program reaches that first assignment statement running interactively under GDB, I get an error "Exception class External : SIGSEGV"<br>
<br>
This is using SVN 38353M (downloaded and built this morning) with FPC 2.6.0 on an AMD Phenom X4 box running Debian SID 64-bit, and generating a 64 bit executable.<br>
<br>
I'm lost. This same code worked under Delphi 7. Can anyone give me a hint as to what I'm doing wrong? I wanted to create the buttons as design time so that I can set the initial layout, but if I need to create them dynamically I can do that.<br>
<br></blockquote><div><br>It will not answer your question (there are few details that are missing there), but I'ved wrote a component for Lazarus few years ago that provide a grid of buttons:<br><a href="https://github.com/ik5/linesip-components">https://github.com/ik5/linesip-components</a><br>
<br>It might be useful for your to try and use it instead, or at least learn from it.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks<br>
<br>
Brian<br></blockquote><div><br>Ido <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
______________________________<u></u>_________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.<u></u>freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.<u></u>freepascal.org/mailman/<u></u>listinfo/lazarus</a><br>
</blockquote></div><br></div>