| Topic |
Description |
| What is
inside a workspace file? |
A workspace file
(e.g., filename.wor) is a plain ascii file that contains the MapBasic commands needed to
re-create a MapInfo session. Workspace files open MapInfo tables; create and
position the necessary Map, Browser and other windows; define layer style and thematic
settings; plus much more. Here's an excerpt from the top of a simple workspace file.
!Workspace
!Version 300
!Charset WindowsLatin1
Open Table "g:\mapdata\wacity" As WACITY Interactive
Open Table "g:\mapdata\wahwy" As WAHWY Interactive
Open Table "WAZip98d" As WAZip98d
Set Window MapBasic
Position (0.125,5.59375) Units "in"
Width 10.3333 Units "in" Height 1.375 Units "in"
...
|
Error:
"Variable or field [column name] is not defined." |
Why:
- After the workspace file was made, someone renamed or deleted a column which is defined
in the workspace as the source of a map label. Even if labels are not "turned
on", the workspace defines the column from which labels will be drawn. The
workspace will "burp" if it doesn't find a column in the table that the
workspace is looking for.
Suggestions:
- Edit the workspace with WordPad or a text editor. Search for
the column name reported in the error message. Replace it with a valid column name. If
unsure of the correct column name, replace the invalid column name with "Col1"
or similar. This will substitute the first column ("Col1") for the invalid
column name.
|
| Workspace
cannot find a table it needs. You are allowed to find and open the table interactively. Message:
"Please locate [tablename]" |
Why:
- After the workspace was made, a MapInfo table referenced in
the workspace was moved to a different directory or renamed. OR
- A table are referenced in the workspace does not have a full
drive letter/path along with the table name. This is normal, if the table is in the
default directory when the workspace is Saved. When Opening a workspace, MapInfo tries to
find this table in your current default directory. Your current default directory is
different that the default directory when your workspace was Saved. OR
- Is the MapInfo table on a network drive? If so, your
workstation computer may use different drive letters than the workstation computer that
made the workspace.
Suggestions:
- Before making a workspace file to distribute to others, put all referenced tables in a
single directory on a single drive. Open the Workspace file manually with with NotePad or
Word and verify that it does not include explicit drive and directory references.
- Beg your network administrator to make sure all workstations on the network use the same
drive letters for network data drives.
- Make several empty "dummy" or "substitute" tables (e.g.,
"substitute1.tab", "substitute2.tab"...). When the workspace asks you
to interactively find a needed table, point to one of these substitute tables if you
cannot find the real one. By doing this, you may be able to open your Workspace file more
completely. This technique is particularly useful if the table in question is referenced
in the workspace but is not a critical one. Special thanks to Tom Curley
|
| Workspace
cannot find a table it needs. Workspace bombs without allowing you a chance to find the
table interactively. Message:
"File [tablename] not found. Unable to open [tablename]." |
Why:
- The workspace file includes an "Open Table ..." command that does not contain
the optional "Interactive" parameter. The optional term is what triggers the
ability to let you interactively find and open the "lost" table.
Suggestions:
- Use Notepad or Word to edit the Workspace file. Add the word "Interactive" to
end of any line in the Workspace that begins with "Open Table ...": OR
- Use Notepad or Word to edit the Workspace file. Revise the drive letter and path to
correctly find the table.
|
Error
message:
"Table [tablename] is already open." |
Why:
- Workspace includes a command to Open a table that is already open.
Suggestions:
- Close all tables with File > Close All ... before Opening the Workspace.
- Encourage MapInfo Corp. to revise the code so this condition will not cause an error
message at all.
|
| MapBasic
commands and functions (eg., "curdate()") can be added manually to workspace
files. But they disappear. |
Why:
- These manual additions disappear whenever MapInfo implements the File > Save
Workspace ... command. When MapInfo saves a workspace it does not edit the old workspace
file, rather it re-writes it completely from scratch. Thus, your manual edits to the
workspace file are lost.
Suggestions:
- Make your workspace files "read only", if users dont really need to edit
them. OR
- Write your own MapBasic utility to create a "Safe Workspace Save..." routine
that preserves your edits. OR
- Use SGSIs "SuperWor.mbx" . This adds commands to the std MapInfo menu to
embed an active current date on your Layout and retains this function in workspace file,
even though the workspace file is saved. Free pre-release copy for Seattle-area MapInfo
Users Group attendees (Sep 98 meeting). Contact SGSI for more information.
information@sgis.com
|
| Using
Workspace files as templates |
To be added at a
future date. |
| Using
Workspace files to document your work |
To be added at a
future date. |