MapInfo Pro Developers User Group

Expand all | Collapse all

Back up and save previous workspace

  • 1.  Back up and save previous workspace

    Posted 07-07-2019 22:55
      |   view attached
    Because of the issue we have been experiencing with some of our Workspaces being corrupted, I thought I'd write a tool to back up the previous version of a Workspace, before saving a new one.

    I've attached the code, which adds an alternative Save and Save As button to the Home Tab.

    However, there is an issue that the GetCurrentWorkspacePath$() statement does not appear to return the currently open workspace in all cases.

    If it is a newly opened MapInfo session - the GetCurrentWorkspacePath$() returns the name of the previously saved workspace in the previous session.  It should return a null value.

    In an already open session, the GetCurrentWorkspacePath$() may return the name of an earlier saved workspace instead of the current workspace name, as displayed at the top of the application window.  This will happen if I've saved the current workspace using MapBasic (eg "save workspace as strMyWorkspace mode current") instead of manually saving using the standard Save As button.

    Is this a bug with the GetCurrentWorkspacePath$() statement, or is there another way to get the name of the current workspace?

    Thanks Kau

    ------------------------------
    Kalu Ribush
    Senior Mapping Specialist
    Department of Economic Development, Jobs, Transport and Resources (DEDJTR)
    Melbourne NT
    ------------------------------

    Attachment(s)

    zip
    Back up and save.zip   70K 1 version


  • 2.  RE: Back up and save previous workspace

    Pitney Bowes
    Posted 07-08-2019 02:06
    Edited by Ashley Crane 07-08-2019 02:17
    Hi @Kalu Ribush - thanks for sharing your Workspace tool​. I agree that the behaviour of the GetCurrentWorkspacePath$() function doesn't match what is expected based on the MapBasic help. I see you've already created a Support Case for this issue - thanks! We'll investigate further & be in contact to share an update with you.

    Thanks, Ashley

    ------------------------------
    Ashley Crane
    Regional Director, Software Support
    Pitney Bowes
    ------------------------------



  • 3.  RE: Back up and save previous workspace

    Pitney Bowes
    Posted 07-12-2019 08:03
    Have you tried out the Pro options to backup and autosave your workspace?


    ------------------------------
    Bob Fortin
    Software Architect and Distinguished Engineer
    ------------------------------



  • 4.  RE: Back up and save previous workspace

    Posted 07-14-2019 19:06
    Hi Bob,
    Yes, we've just started using the Backup and Autosave options. I think these will help us recover from any corruption problems in the future. I made a separate post in the MapInfo Lab forum about these options.
    Regards

    ------------------------------
    Kalu Ribush
    Senior Mapping Specialist
    Department of Economic Development, Jobs, Transport and Resources (DEDJTR)
    Melbourne NT
    ------------------------------