Well, this one is ancient. It goes back to version 5.5 where MapInfo introduced 
the ability to store queries in workspaces.

We have had occassions where saving a workspace from within MapBasic would 
fail, if the preference to store queries in workspaces was turned on.
The command will only fail, if there is a query to store to the workspace.

The workaround was to use the Run Command way as shown. 

I just checked with MapInfo 8.0 Build 33: This problem still persists.

Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Thoen
Sent: Monday, January 23, 2006 3:13 PM
To: [email protected]
Subject: Re: [MI-L] saving workspace in mapbasic

Peter,

Which bug? I've got a open call with MI tech support currently about the "Save 
workspace..." command which exhibits the following behavior:

If you have made a selection and have added it as a map layer, the command Save 
Workspace As "MyWorkspace.WOR" does not work (it doesn't write the whole 
workspace.) Without the selection, it seems to be fine. But have you found 
another bug?

- Bill Thoen

On Sun, Jan 22, 2006 at 08:00:52PM +0100, Peter Horsbøll Møller wrote:
> I'm not sure whether MapInfo has fixed a bug that appeared a while ago 
> when saving workspaces thru MapBasic applications.
> 
> But any way, there is a simple workaround that should be applied to be
> safe:
> 
> When saving the workspace, use a command string and add "" to the filename:
> 
> Run Command "Save  Workspace  As  " & Chr$(34) & sPath & sFilename & 
> Chr$(34)
> 
> Peter Horsbøll Møller
> GIS Developer, MTM
> Geographical Information & IT
>  
> COWI A/S
> Odensevej 95
> DK-5260 Odense S.
> Denmark
>  
> Tel   +45 6311 4900
> Direct        +45 6311 4908
> Mob   +45 5156 1045
> Fax   +45 6311 4949
> E-mail        [EMAIL PROTECTED]
> http://www.cowi.dk/gis
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> Sent: Friday, January 20, 2006 1:19 AM
> To: Robert DeRubeis
> Cc: [email protected]
> Subject: Re: [MI-L] saving workspace in mapbasic
> 
> The directory that comes up would either be the preset workspaces 
> directory, or the directory of the last file opened/saved.
> 
> In MapBasic Help File - Look up:
>     FileOpenDlg()
>     PathToFileName$()
>      PathToDirectory$()
>     FileSaveAsDlg ()
>     Save  Workspace  As
> 
> sample code suggestion:
> 
> Global filename, path as String
> 
> SubButton1
> filespec = FileOpenDlg( path ,  filename ,  ".WOR" ,  prompt ) 
> filename = PathToFileName$( filespec ) path = PathToDirectory$( 
> filespec )
> 
> SubButton3
> filespec = FileSaveAsDlg ( path ,  filename,  ".WOR",  prompt ) Save  
> Workspace  As  filespec
> 
> 
> SubAlternateButton3
> Save  Workspace  As  path+filename
> 
> - Steve
> 
> On 1/20/06, Robert DeRubeis <[EMAIL PROTECTED]> wrote:
> >
> > Hi list,
> >
> > I have a mapbasic program I wrote with 3 seperate push buttons.  The 
> > first opens a dialog box to open a workspace.  The second closes a 
> > list of the old streetpro bottom portion of the hwy shields for 
> > every state that is no longer used, but referenced in the saved workspace.
> > The third button saves the workspace.
> >
> > My problem is in getting mapbasic to resave the current workspace.  
> > I'm using the following command- Run menu command 109.  This has the 
> > correct workspace name that was opened up, but prompts the user to 
> > select save workspace and the directory where it is prompting to be 
> > saved in is not the correct directory where that workspace was opened.
> >
> > Is there a way to simply have the workspace saved to the same 
> > directory it was opened up in so that it overwrites the old 
> > workspace and no longer references the old streetpro tables?  I 
> > cannot define a certain directory for the workspaces to be saved 
> > because they are all in many different directories.
> >
> > I'm using v7.8 on winXP.
> >
> > Any help is appreciated.
> >
> > Thansk,
> > Bob
> >
> >
> >
> >
> > _______________________________________________
> > MapInfo-L mailing list
> > [email protected]
> > http://www.directionsmag.com/mailman/listinfo/mapinfo-l
> >
> _______________________________________________
> MapInfo-L mailing list
> [email protected]
> http://www.directionsmag.com/mailman/listinfo/mapinfo-l
> 
> 
> 
> _______________________________________________
> MapInfo-L mailing list
> [email protected]
> http://www.directionsmag.com/mailman/listinfo/mapinfo-l
> 
_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l



_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to