<div dir="ltr"><br><div dir="ltr"><br></div><br>
<br><br><div class="gmail_quote">On Sun, Apr 10, 2011 at 22:20, Bo Berglund <span dir="ltr"><<a href="mailto:bo.berglund@gmail.com">bo.berglund@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I was using Lazarus to create a console application for parsing out<br>
data from a network speed test program.<br>
<br>
In this case I used the Lazarus new project dialogue and specified a<br>
console application with all the defaults.<br>
<br>
This creates an application framework including command line parameter<br>
parsing, which is good. I use the cl to pass file names (input and<br>
output).<br>
<br>
My problem is this:<br>
I went to the section in DoRun where it states:<br>
  { add your program here }<br>
<br>
This is exatly what I did. The code parses out a report file and<br>
extracts the valid data, then writes it out to a file (append at end<br>
of that file) using TStringList.SaveToFile.<br>
This all works fine so far, but when this is done the code gets to the<br>
predefined statement:<br>
<br>
  // stop program loop<br>
  Terminate;<br>
<br>
And here I am getting an exception:<br>
External: SIGSEGV<br>
<br>
If I comment out Terminate then the program never ends....<br></blockquote><div><br>It's a feature (the Terminate), not a bug. <br>The program is executed in a loop that parses data such as events and more (regardless of it being terminal app).<br>

Terminate "break" the loop and allow you to finish the execution. <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Is this specific to Ubuntu Linux or is it some error in my coding that<br>
causes this?<br>
<br>
I am using two objects in the DoRun, one TStringList and one object i<br>
created for parsing the data. Both are created and then freed in a<br>
try-finally construct before the Terminate call.<br>
<br>
All is fine up until this spot, the file is parsed and the result is<br>
written, yet I get the exception.<br>
<br>
Can someone please explain this?<br></blockquote><div><br>Can you execute it with debug code and see where the crash happens ?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<br>
<br>
--<br>
Bo Berglund<br>
Developer in Sweden<br>
<font color="#888888"><br>
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</font></blockquote></div><br><br>Ido<br clear="all">LINESIP - Opening the source for communication<br><a href="http://www.linesip.com/" target="_blank">http://www.linesip.com</a><br><a href="http://www.linesip.co.il/" target="_blank">http://www.linesip.co.il</a><br>

</div>