Format$(CommandInfo(CMD_INFO_X),".#######") will return the precise value (7 decimals).

--
Jaromir SVASTA
Hydrogeologist
Geological Survey of Slovak Republic
Mlynska dolina 1
917 04 Bratislava
Slovak Republic

Tel: +421 2 59375326
Fax: +421 2 54771940
On Fri, 3 Sep 2004 18:20:23 +0200, rugo100 <[EMAIL PROTECTED]> wrote:

Hi,

I am using MapBasic from MS VisualBasic and I have problem with precision
during centering of MAP.

I have point objects in a table.
as I select any of them (with my program by an algorithm), I want to center
the map on that point.
To do this I try to use this code:
(In var "f" there is the index of point what I want to select)


'Find the point:
msg = "Find """ & f & """"
MapInfo.do msg

'Check wether object found?
msg = "CommandInfo(3) >= CMD_INFO_FIND_RC'"
r = MapInfo.Eval(msg)
If r = "T" Then
' yes, object was found, obtain Lat/Lon of object:
X = MapInfo.Eval("CommandInfo(CMD_INFO_X)")
Y = MapInfo.Eval("CommandInfo(CMD_INFO_Y)")
'Then I center map on obtained x,y:
msg = "Set Map Center (" & X & "," & Y & ")" + " Smart Redraw"
MapInfo.do msg
else
....
....
This code basically works. The only problem is with the precision of X,Y !
Although point objects Lat/Lon is with 6 digits after decimal points, when I
use above code X,Y gives only 3-4 digits after decimal point. As a result of
this centering of map slightly "flickering" (depends on how big is the
differenc between the original -six digits- coordinate and obtained X,Y
value...)


E.g. original coordinate of a pont:     18.475058     47.201188
But in X,Y I got from commandinfo:   18.475         47.201

How can I get the precise value from Commandinfo ?

Any help would be highly appreciated.

Thanks
George



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13212



________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13219



Reply via email to