[Lazarus] AV exception error on "lower1 := left" (integer variable assignment)... Can anyone explain this???

Peter E Williams pewslinuxvault at gmail.com
Sun Apr 24 01:39:20 CEST 2011


Hi Mattias,

On 24 April 2011 09:31, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:

> On Sun, 24 Apr 2011 08:58:07 +1000
> Peter E Williams <pewslinuxvault at gmail.com> wrote:
>
> > Hi All,
> >
> > I am having a problem with a strange run-time AV error. See the link to
> the
> > Lazarus project.
> >
> > Download link:
> > http://hotfile.com/dl/115480488/6b7a8ed/dtm_maker_001.zip.html
> >
> > The problem is in the QSort procedure:
> >
> >[...]
> >     pivot := island_single_array[left].location_number;
>
> "pivot" is the key of the pivot element at position "left".
>
> >[...]
> >     pivot := island_single_array[left].location_number;
> >     left := lower1;
> >     right := upper1;
> >     if left < pivot then
>          ^^^^^^^^^^^^
> Comparing a position and a key makes no sense.
>
> You have to keep track of the position of the pivot element. See the
> quicksort implementation in TFPList.Sort.
>
>
Could you please give me a link to the TFPList.Sort code so that I can use
that code (via cut and paste) in my unit ?

Thanks and best regards,
Peter / pew


> Mattias
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110424/f0df8793/attachment-0003.html>


More information about the Lazarus mailing list