Set coordsys table tablename
Update Tablename set obj = Createline(site1_longitude ,site1_latitude
,site2_longitude ,site2_latitude )
Before doing the above you'll need to make the table 'mappable' through
Table -> Maintenance -> Table Structure and tick the 'Table is Mappable'
option. At this point you can also select the correct projection, if
you haven't set one as the default.
If your lat/long coordinates aren't in decimal degrees then you'll have
to convert them first and you can use the Degree Converter tool that
comes with MapInfo (under Tools -> Tool Manager) to do this.
HTH
Greg Driver
System Administrator
Applications Support
ICT
Surrey Police
NOT PROTECTIVELY MARKED
Hi Zved,
Pete
*Internet communications are not secure and therefore Surrey Police does not accept legal responsibility for the contents of this message. This email and any attachments may be confidential. They may contain privileged information and are intended for the named addressee (s) only. They must not be distributed without our consent. If you are not the intended recipient, please notify us immediately and delete the message and any attachments from your computer, do not disclose, distribute, or retain this email or any part of it. Unless expressly stated, opinions in this email are those of the individual sender, and not of Surrey Police. We believe but do not warrant that this e-mail and any attachments are virus free. You must therefore take full responsibility for virus checking. Surrey Police reserves the right to monitor all email communications through their networks.*
Dim line as object line = CreateObject(<startX>,<startY>,<endX>,<endY>)update <yourTable> set obj = lineAlter line Info 2, MakePen(1, 2, <yourColor>)Function ChangeColor( ByVal oTarget As Object, ByVal penNew As Pen) As Object
Alter oTarget Info 2, newPen
ChangeColor = oTarget
End Functionselect * from XL where MyVal = 3 into ToStyle noselect set style pen (2,7,16711935) Update ToStyle set obj = createline(X1,Y1,X2,Y2) select * from XL where MyVal = 5 into ToStyle noselect set style pen (2,7,255) Update ToStyle set obj = createline(X1,Y1,X2,Y2)etc...
-- Andy Harfoot GeoData Institute University of Southampton Southampton SO17 1BJ Tel: +44 (0)23 8059 2719 www.geodata.soton.ac.uk