Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,094
    • Issues 2,094
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 7
    • Merge requests 7
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

Scheduled maintenance on the database layer will take place on 2022-07-02. We expect GitLab.com to be unavailable for up to 2 hours starting from 06:00 UTC. Kindly follow our status page for updates and read more in our blog post.

  • FPC
  • Lazarus
  • LazarusLazarus
  • Issues
  • #22854
Closed
Open
Created Sep 11, 2012 by FPC Admin account@fpc_adminOwner

function TBasicPointSeries.GetNearestPoint can fail

Original Reporter info from Mantis: mbuckingham
  • Reporter name:

Description:

The function TBasicPointSeries.GetNearestPoint returns a boolean and the assumption my code makes is that TRUE means everything worked OK. However the function only checks if the number of points in the series is greater than zero.

It is possible for none of the points in the series to be with the radius specified but the function will still return TRUE and this then leads to an 'EListError'. The only way I have of checking for this is by testing if AResults.FDist is equal to MaxInt, but this requires knowledge of the internal working s of GetNearestPoint.

Additional information:

One possible fix is to set Result to FALSE at the start of the function. Then set Result to TRUE as the last line of the "for i := 0 to Count - 1" loop. The function will then only return TRUE once it has successfully found a point within the given radius.

Mantis conversion info:

  • Mantis ID: 22854
  • Version: 1.0.0
  • Fixed in revision: 38617 (#fd49bc20)
Assignee
Assign to
Time tracking