[Lazarus] Strange Access Violation

ajv ajv at vogelaar-electronics.com
Mon Aug 2 22:04:54 CEST 2010


First use a Try Except clause:

01    for i:=0 to ElementCount do
02    begin
03      CommaString:=LoadElementFromNumber(i);
04      if CommaString<>'' then
05      begin
06        ElementList:=TStringList.Create;
07        Try ElementList.CommaText:=CommaString;
08            Try CheckElementExtents(ElementList);
               Except
                  ShowMessage ('Something wrong with CheckElementExtents);
               End
09        Finally
              ElementList.Free;
           End
10      end;
11    end;

What are your results?
Anthony.
===========================================

On 08/02/2010 08:51 PM, Dave Coventry wrote:
> I'm using a name/value comma-separated string to read a DXF drawing
> file into a TStringList.
>
> The comma-separated string is probably 200 characters long.
>
> I'm getting an exception class 'External: SIGSEGV' and 'RunError(216)'.
>
> Here is the offending code:
>
> 01    for i:=0 to ElementCount do
> 02    begin
> 03      CommaString:=LoadElementFromNumber(i);
> 04      if CommaString<>'' then
> 05      begin
> 06        ElementList:=TStringList.Create;
> 07        ElementList.CommaText:=CommaString;
> 08        CheckElementExtents(ElementList);
> 09        ElementList.Free;
> 10      end;
> 11    end;
>
> The loop repeats without problem until i=10 but fails with  Errors
> occur on ElementList.Free. (Line 09). ElementCount = 20.
>
> I'm using SVN Revision 26845 on Ubuntu.
>
> Can someone suggest what I'm doing wrong?
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>    





More information about the Lazarus mailing list