Workspace Save Issues in MapInfo 11

282 views
Skip to first unread message

Peadar

unread,
Nov 14, 2011, 2:17:46 AM11/14/11
to MapInfo-L
Hi,
This is my first post here, but I was wondering if anyone else was
having issues saving workspaces in MapInfo 11?
I have a situation where I am creating multiple layouts using MapBasic
then saving the workspace using the "Save Workspace" command.
The first lines of the workspace are right (opening tables), but then
the workspace trys to set the printer of the frontwindow(), but
there's no preceeding command to establish a map window (thus an error
occurs opening the workspace).

e.g.
!Workspace
!Version 950
!Charset WindowsLatin1
Open Table "table1" As tab1 Interactive
Open Table "table2" As tab2 Interactive
Set Window FrontWindow() Printer '
<--- This is the error line, as there's no frontwindow
Name "Canon iR" Orientation Landscape Copies 1
Papersize 8
Map From tab1,tab2
Position (0.0416667,0.0416667) Units "in"
Width 11 Units "in" Height 9.3125 Units "in"
Set Window FrontWindow() ScrollBars Off Autoscroll On
'more lines of workspace.....

I don't know why MapInfo is doing this. It's very odd.
Anyone have any ideas?
I appreciate comments from anyone who knows how to solve this little
oddity...
Thanks!
Peadar
Experienced MapBasic user, Corporate Customer of PBinsight.

Thomas Bacon

unread,
Nov 14, 2011, 3:45:43 AM11/14/11
to mapi...@googlegroups.com
Hi Peadar,

That does seem odd. You would think MapInfo would be aware when writing
the workspace that there are no windows open. One way around it would be
to comment out the 'Set Window...' lines from the workspace. As you
haven't included the rest of the workspace text I don't know whether
this will have any effect on the rest of the workspace, though I don't
think it should by the looks of it.

HTH,

Tom Bacon
Graduate GIS Engineer
Asset Management South
Tel: 01444 472380
www.mouchel.com

--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en


The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX Registered No : 1686040

Mats Elfström

unread,
Nov 14, 2011, 8:07:38 AM11/14/11
to mapi...@googlegroups.com
Hi!
The thing may be that MI Pro does not know what the MapBasic script has done, and writes to workspace only that which is done in the GUI (or in other words, stuff which is presented in the MapBasic command window of the GUI).
One way to check what is going on is to 'test save' the workspace by printing it to the message window.
I do not have MI/MB right here, so I cannot state the exact command for this.
Seek and ye shall find in the MB help I think.

As a side note: I am facing unemployment. Any suggestions where my GIS and MapInfo skills may be needed are gladly accepted. I can work anywhere in the world (virtually of course, I will be physically located in Sweden).

Regards, Mats.E

2011/11/14 Thomas Bacon <Thomas...@mouchel.com>



--
______________________________________________
Mats Elfström, Väpplingvägen 21, SE-227 38 LUND, Sweden
tel: +46 46 145959 / mob: +46 70 595 39 35
alt e-mail: mats.e...@telia.com


Roopesh Kumar

unread,
Nov 14, 2011, 9:23:34 AM11/14/11
to mapi...@googlegroups.com
HI
 
I want to make link b/w 2 sites,half and half with other color showing high low at both end
data i have lat/long and freq at both end high and low
can anyone suggest how to draw line showing the links high low

--
Regards
Roopesh Kumar

Eric Blasenheim

unread,
Nov 14, 2011, 11:32:28 AM11/14/11
to MapInfo-L
As a point of information, what Professional writes out into a
workspace is not impacted by how it was created. It does not even keep
track of how (UI, MBX, MB Windows) it was created. It tries to save
all the current Tables and then all the open windows into the
workspace. It has certain things it skips, like query tables that it
cannot reliably reproduce and looks at various preferences, but this
has nothing to do with how they were created.

I was not able to reproduce the reported error. The printer
information is usually one of the last properties of a window written
out so the example posted here looks like what you would see if you
manually removed everything else. Hopefully someone can reproduce so
that we can look into the issue.
Eric Blasenheim
PBBI (MapInfo)



On Nov 14, 8:07 am, Mats Elfström <mats.elfst...@gmail.com> wrote:
> Hi!
> The thing may be that MI Pro does not know what the MapBasic script has
> done, and writes to workspace only that which is done in the GUI (or in
> other words, stuff which is presented in the MapBasic command window of the
> GUI).
> One way to check what is going on is to 'test save' the workspace by
> printing it to the message window.
> I do not have MI/MB right here, so I cannot state the exact command for
> this.
> Seek and ye shall find in the MB help I think.
>
> As a side note: I am facing unemployment. Any suggestions where my GIS and
> MapInfo skills may be needed are gladly accepted. I can work anywhere in
> the world (virtually of course, I will be physically located in Sweden).
>
> Regards, Mats.E
>
> 2011/11/14 Thomas Bacon <Thomas.Ba...@mouchel.com>
> alt e-mail: mats.elfst...@telia.com- Hide quoted text -
>
> - Show quoted text -

Peadar

unread,
Nov 15, 2011, 8:40:36 PM11/15/11
to MapInfo-L
Thanks everyone, I appreciate your time.
I can't post the original Workspace due to sensitivity of the file,
but the only thing I removed before the error were extra lines of
"opening tables". Nothing else until the "Set Window" statement. I
cannot for the life of me understand why MapInfo is writing the Set
Window statement before creating a window. I've never seen MapInfo do
this. Incidentally, My colleagues testing this script can't replicate
the problem either (using the same data sets) - but they're running
MapInfo 10.5, not 11.0
As Thomas suggested, I can manually edit the workspace, to get it to
run, but I am writing the MapBasic script for deployment to hundreds
of staff (who will be running 11.0), so I'd much rather fix the
problem.

I guess it's something weird with my installation. Sadly, I'm not at
all happy with the upgrade to 11.0. The bugs and overall slowness
make me I wish I stayed with 10.5. Admittedly, I didn't know that
that there was a Maintenance release, so I'll try the upgrade and see
if the bugs/sluggishness persists.

Once again, thanks for your time!!
Peadar.

PS @ Mats.E, sorry, I don't know anyone hiring at the moment...

peter horsboll moller

unread,
Nov 16, 2011, 1:22:51 AM11/16/11
to mapi...@googlegroups.com
Can you reproduce the workspace in MI Pro 11,but not with v10.5?

Peter

----- Oprindelig meddelelse -----
Fra: Peadar <wherei...@gmail.com>
Sendt: 16. november 2011 02:40
Til: MapInfo-L <mapi...@googlegroups.com>
Emne: [MI-L] Re: Workspace Save Issues in MapInfo 11


[Hele den oprindelige meddelelse er ikke inkluderet]

smart...@gmail.com

unread,
Nov 16, 2011, 8:44:07 AM11/16/11
to MapInfo-L

By any chance, were you creating a map where ALL of the layers were
based on queries?

I seem to recall cases where not all queries were preserved in the WOR
file.
If all of the layers in a map were based on such query tables, that
might explain why your WOR doesn't preserve the map at all (but
leaves behind a residual Set Printer that had been associated with the
now-missing Map...)



On Nov 16, 1:22 am, peter horsboll moller
<p.horsboll.mol...@gmail.com> wrote:
> Can you reproduce the workspace in MI Pro 11,but not with v10.5?
>
> Peter
>
> ----- Oprindelig meddelelse -----
> Fra: Peadar <whereispea...@gmail.com>

Peadar

unread,
Nov 16, 2011, 8:29:48 PM11/16/11
to MapInfo-L
Hi Peter,
I was mistaken about the MapInfo 10.5 v 11.0 - my colleagues testing
it in 10.5 found the issue last night (although, for some reason
couldn't replicate it earlier). Sorry about the misdirection on that
one.
Sadly, no, none of the maps were based entirely on queries.

Thanks for your time on this one Peter! I realise most of these
things are chasing little insanities...

In my script, I am creating a Map, then layout, then printing the
layout to PDF using the supplied MapInfo PDF printer. I repeat this
several times for various maps, then I save the workspace at the end
(when all the maps and layouts are open). I've noticed that if I
prevent the PDF printing, the workspace saves just fine.
So my work-around in this case is to create all of my layouts, save
the workspace, then go back and print the layouts to PDF.
Thus my suspicion is that it's either something to do with the way I'm
formatting to the printer, or a bug caused from the call to the PDF
printer.

My code being:
======================================
Dim iStr as String
Dim strPDFname as String '(this variable contains the name of the
file to store the PDF, which is checked prior to only contain numbers,
letters and underscores)
Dim OutFolder as String '(this is the folder path to the location
of the place I want to save the PDFs)

If ((SystemInfo(SYS_INFO_MIVERSION) / 100) > 9.5) Then
OnError GoTo PDF_FAILURE
iStr = "MapInfo PDF Printer Version " & Format$
((SystemInfo(SYS_INFO_MIVERSION) / 100), "00.0")
Set Window FrontWindow() Printer
Name iStr Orientation Landscape Copies 1
Papersize 66 ' 66 = A2
iStr = OutFolder & strPDFname & ".pdf"
Print "Creating " & strPDFname
PrintWin Window frontwindow() File iStr Overwrite
End If
End Program
PDF_FAILURE:
'error handler that skips the rest of the PDF printing
======================================
In any case, I have it working now so problem solved :)

Thanks again,
Peadar.

On Nov 16, 11:44 pm, "smartgro...@gmail.com" <smartgro...@gmail.com>
wrote:

Peadar

unread,
Nov 16, 2011, 9:57:43 PM11/16/11
to MapInfo-L
Wait, no that seemed to work but now the problem is back, so my work-
around isn't working.
Reply all
Reply to author
Forward
0 new messages