There's more to experience when you log in!
We have a Mapbasic program that works its way down a MapInfo Table and re-centers the map window based on values in each record in the table. It then saves a new named workspace after each record.
The program opens a template Workspace with a Map Window as the Front Window
It then sets the centre easting and northing and zoom width based on values in the table
set map window frontwindow() center (iCOP_east, iCOP_north)
set Map window frontwindow() zoom iWidth Units "m"
We are then trying to centre and size a second Map Window in the same Workspace which is not the Front Window.How do we write the Mapbasic to specify that we want to Change View for that second Map Window?We are using Mapbasic 15 and MapInfo Pro 15.0.3.Thank you,Alan.
Dim nWIn, nFirstMID, nSecondMID As IntegerFor nWin = 1 To NumWindows()
If WindowInfo(WindowID(nWin), WIN_INFO_TYPE) = WIN_MAPPER Then
If WindowID(nWID) = FrontWindow() Then
'Ah, we found the front map window nFirstMID = WindowID(nWin) Else 'Ah, we found the other map window nSecondMID = WindowID(nWin)
Function WINGetIDFromTitle(ByVal sTitle As String) As Integer
Dim i As Integer
OnError GoTo ErrorOccured
WINGetIDFromTitle = 0
If sTitle = "" Then
For i = 1 To NumWindows()
If WindowInfo(WindowID(i), WIN_INFO_NAME) = sTitle Then
WINGetIDFromTitle = WindowID(i)
Call ERRCreate(Err(), Error$(), "WINGetIDFromTitle")