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] [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Chan
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

Reply via email to