Hi David,

You could treat workspaces as text files and open them to check for
everything you need and then write a new workspace:

My suggestion is first to check the table problem and then the label problem
*******************

(..)
Open File gsArbOmr For Input  As #1 CharSet "WindowsLatin1"
Open File sWORname For Output As #2 CharSet "WindowsLatin1" 
(..)
Do While Not EOF(1)
  Line Input #1, gsStr
        If Left$(LTrim$(gsStr),10)="Open Table" 
        Then 
                Call StringChk 
        End If
  If Not EOF(1) Then ' Or something else... If you divide the solution in
two then just open the tables
    Print #2, gsStr
  End If
 Loop 
********************
In the sub "StringChk" you can check for quotationmarks (") (chr$(34))
        j=1
        i=j
        j=InStr(i,gsStr,Chr$(34))
        i=InStr(j+1,gsStr,Chr$(34))
        gsPathName=Mid$(gsStr, j+1, i-j-1)+".tab"
***************
Now you can do a "FileExists()" on gsPathName to check the presence of the
table.

The next part is the label problem:
If you now have all your tables open and nothing else, you can maybe treat
the rest of the workspace as separate commands. These commands can be
executed with mb.
Set up an errorhandler to deal with the errors. If there is an error with a
label reference rename it to "COL1"
Remember that the commands from the workspace run over more that one line
e.g. "Set Map Layer..."

You might find inspiration from:

http://mb.breddam.dk/Programmer/WorTjek/WORtjek.zip


HTH

S�ren Breddam
GIS- og IT-koordinator
Teknik og Erhvervsforvaltningen
Stevns Kommune - www.stevns.dk 
*      Tlf.:   5656 1800
*      Dir.:   5656 1891



-----Oprindelig meddelelse-----
Fra: David Reid [mailto:[EMAIL PROTECTED]
Sendt: 6. august 2004 23:27
Til: MapInfo-L
Emne: MI-L Error messages opening corrupted workspace files


Afternoon/Morning/Evening List,

Is there a method via Mapbasic or the Mapbasic window, by which I can record
the
error messages given when opening a Workspace file with errors like
disassociated labels?

I have some old workspaces I'd like to check up on, some have many many
errors
like references to tables no longer available, but mostly, the label
problems.

Workspace Control from 4th Beach sofware doesn't seem to cover everything
(at
least the version I was evaluating.

Thanks,
David Reid



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12873

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12877

Reply via email to