Hi All I have a mapbasic program that uses the distance function in a query to join two tables and list the distances between the two sets of eastings and northings.
I first wrote the code in Mapbasic window in mapinfo and pasted into mapbasic,( in mapinfo) this did not work correctly (incorrect distance values)at first until I set the coordsys of one of the tables before executing the query again. In the mapbasic window (in mapinfo) I wrote the following two lines of code Set coordsy table "table1" Select table1.shopname,table2.shopname, Distance(table1.x,table1.y,table2.x,table2.y,"Mi")where table1.link = table2.link into selection Browse * from selection Upon running this in the mapbasic window (in mapinfo) line by line it worked correctly And a browser was produced with the distances correctly measured. I pasted this code into Mapbasic and compiled without errors I had to change the statement a little to run the sql Set coordsys table "table" S = Select etc etc Run command S But once run as a program, the results did not work from MapBasic. The browser appears but the distance values are all zeros. If then I go into Mapbasic window in mapinfo and write Set coordsys table "table1" And press enter an hour glass appears then the browser that was previously open updates with the correct distances. Why is exactly the same code not working in mapbasic but works in the mapbasic window in mapinfo.. Hope somebody can please help. I feel like I am going round in circles Thanks Jamie This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding. --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11855
