MapInfo Pro

 View Only
  • 1.  How could I get more accurate result from ObjectNodeX in Mapbasic

    Posted 04-11-2019 02:07
    I want get the Coordinates of a object.

    this is my code 
    x = ObjectNodeX(route.obj, 1, 1) ' read longitude
    y = ObjectNodeY(route.obj, 1, 1) ' read latitude
    note x +"," + y

    But its result is only three to four decimal places.
    Such as:

    How could I get more accurate result?

    ------------------------------
    Zhipeng Wang
    Knowledge Community Shared Account
    Beijing, China
    ------------------------------


  • 2.  RE: How could I get more accurate result from ObjectNodeX in Mapbasic
    Best Answer

    Employee
    Posted 04-12-2019 06:37
    Assuming X & Y are float variables, use the  Format$() function  to show more decimals (if there are any).
    Format$(ObjectNodeX(route.obj, 1, 1),"###.######")

    ------------------------------
    Bill Wemple
    Principal QA Engineer
    Pitney Bowes
    Troy, NY
    ------------------------------



  • 3.  RE: How could I get more accurate result from ObjectNodeX in Mapbasic

    Posted 04-12-2019 06:41
    It could work, thank you very much.

    ------------------------------
    Zhipeng Wang
    Knowledge Community Shared Account
    Shelton CT
    ------------------------------