On Sun, Apr 10, 2011 at 22:20, Bo Berglund <[email protected]> wrote:
> I was using Lazarus to create a console application for parsing out
> data from a network speed test program.
>
> In this case I used the Lazarus new project dialogue and specified a
> console application with all the defaults.
>
> This creates an application framework including command line parameter
> parsing, which is good. I use the cl to pass file names (input and
> output).
>
> My problem is this:
> I went to the section in DoRun where it states:
> { add your program here }
>
> This is exatly what I did. The code parses out a report file and
> extracts the valid data, then writes it out to a file (append at end
> of that file) using TStringList.SaveToFile.
> This all works fine so far, but when this is done the code gets to the
> predefined statement:
>
> // stop program loop
> Terminate;
>
> And here I am getting an exception:
> External: SIGSEGV
>
> If I comment out Terminate then the program never ends....
>
It's a feature (the Terminate), not a bug.
The program is executed in a loop that parses data such as events and more
(regardless of it being terminal app).
Terminate "break" the loop and allow you to finish the execution.
>
> Is this specific to Ubuntu Linux or is it some error in my coding that
> causes this?
>
> I am using two objects in the DoRun, one TStringList and one object i
> created for parsing the data. Both are created and then freed in a
> try-finally construct before the Terminate call.
>
> All is fine up until this spot, the file is parsed and the result is
> written, yet I get the exception.
>
> Can someone please explain this?
>
Can you execute it with debug code and see where the crash happens ?
>
>
> --
> Bo Berglund
> Developer in Sweden
>
>
> --
> _______________________________________________
> Lazarus mailing list
> [email protected]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
Ido
LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus