@@ -22,11 +22,9 @@ Sub GetTableCoordSys 'Blockstart
2222
2323 ' Find the projection
2424 TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
25-
26- Note "The coordinate system for " + TableName + " is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
2725
28- Print "The coordinate system for " + TableName + " is:" & CoordSysName$ (TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10 )
29-
26+ Call ShowCoordsys (TheProjection)
27+
3028End Sub 'Blockend
3129
3230Sub GetWindowCoordSys 'Blockstart
@@ -46,19 +44,17 @@ Sub GetWindowCoordSys 'Blockstart
4644
4745 If WindowType = WIN_MAPPER Then
4846 TheProjection = MapperInfo(TheWindowID, MAPPER_INFO_COORDSYS_CLAUSE)
49- Note "The projection is:" & Chr$(10) & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
50-
51- Print "The coordinate system is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10)
47+
48+ Call ShowCoordsys(TheProjection)
5249
5350 ElseIf WindowType = WIN_BROWSER Then
54- Dim TableName as String
51+ ' Dim TableName as String
5552
56- TableName = WindowInfo(TheWindowId, WIN_INFO_TABLE)
57- TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
53+ 'TableName = WindowInfo(TheWindowId, WIN_INFO_TABLE)
54+ 'TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
55+ TheProjection = TableInfo(WindowInfo(TheWindowId, WIN_INFO_TABLE), TAB_INFO_COORDSYS_CLAUSE)
5856
59- Note "The projection is:" & Chr$(10) & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
60-
61- Print "The coordinate system is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10)
57+ Call ShowCoordsys(TheProjection)
6258 Else
6359 Note "Can't get the projection for that window."
6460 End If
@@ -67,3 +63,15 @@ Sub GetWindowCoordSys 'Blockstart
6763Borked:
6864 Note "Error: "+ Error$()
6965End Sub 'Blockend
66+
67+ Sub ShowCoordsys(proj as string) 'Blockstart
68+ Note "The coordinate system is: " & CoordSysName$(proj) & Chr$(10) & Chr$(10) &
69+ "See the print window for more information."
70+
71+ Print "The coordinate system is:" &
72+ CoordSysName$(proj) & Chr$(10) & Chr$(10) &
73+ "Full MapInfo coord string: " & Chr$(10) & proj & Chr$(10) & Chr$(10) &
74+ "EPSG: " & CoordSysStringToEPSG(proj) & Chr$(10) &
75+ "PRJ: " & CoordSysStringToPRJ$(proj) & Chr$(10) &
76+ "WKT: " & CoordSysStringToWKT$(proj) & Chr$(10)
77+ End Sub 'Blockend
0 commit comments