Add Objects with ID
V 2.01 for
MBX version 4
Jacques
Paris
The purpose is to add objects (limited to Point, Line,
Polyline and Polygon types)
to an existing table with an automatically assigned identifier. The table must
contain a column to store those identifiers
Identifier
types
Integer range from 1 to 2 147 483 647
Smallint
range from 1 to 32 767
String (alpha) formed of 2 parts of fixed length, the
first one being treated as a set of invariant letters, the
second as variable characters treated as digits.
We are conscious that this alphanumeric format is far
from being universal. The solution we offer is a compromise that could leave a
good number of users unsatisfied. If some agreement could be reached, the agreed
upon format could certainly be added to this application.
Identifier
assignation
Integer and smallint : the new object receives as identifier the number
following the highest value already assigned.
Alpha :
the new object receives as identifier a string formed with the alpha fixed part
and the number converted into a string of fixed length following the number
extracted from the last record in the table.
If the automatic assignation of numeric identifiers
prevents the assignation of duplicate numbers, there is no such guarantee with
alpha identifiers; the presence of a fixed length with potentially mixed
letters could create multiple « series » that the application is
unable to handle. The user must manage
that situation with his own resources.
Missing identifiers
Before any addition of objects, the application
verifies if every object has its identifier. If any ID is missing, the program
asks if they should be added, the user accepting or refusing the offer. The
procedure differs lightly depending on the type of identifier.
Integer and Smallint : the program offers as the identifier of the first
missing object the number following the highest value in the identifier column.
The user can accept that value or adopt any other higher value.
Alpha :
the identifier of the first missing object is automatically formed by the
string (invariant part) and the number
converted into string as they have been specified by the user.
Installing and Adjusting
Installation
The .INI file must be placed in the same directory as
the MBX (application directory). If no ini file is
found there, a new file will be generated in FRENCH ONLY.
If the documentation files …_doc.txt and …_doc.htm and
the directory of images for the htm page …_files are
found in the archive, they must also be placed in the application directory.
There must a set of these documents for each language
Launching
When launched, the program installs a sub-menu in the
Tools menu (or a menu in the main bar if the MI version is <4.5) and a
toolbar.
Adjusting
Two menu items allow some adjustment of the
application « look »
Display
Language allows changing the language used by the
application itself (not that of MapInfo or Windows)
Toolbar
allows to save the preferred position of the toolbar, docked (top row is 0,
first position to the left 0) or floating (X and Y in inches from the upper top
corner of the screen)
Use
The table to which objects are to be added must be
open.
1 – Menu « Select one of the open tables »
or Icon « Table »
|
|
1 – Choose
an open table |
2 – Type of ID column |
|
|
Alpha
identifier only |
3 – Choose
ID column |
Numerical ID:
If there is no column of the required type (Integer ou
smallint), the procedure stops.
Alpha ID: If there is no column of the Char type with a
width = or > to the sum of the fixed and variable parts, the procedure
stops.
The
“addition” icons become accessible
2 – Missing Identifiers
Numeric :
automatic assignation starting with the number following the highest value
found in the ID column and increasing by 1 with new assignation.
Alpha :
|
The user enters, while respecting the numbers he chose,
the fixed characters and the base number (variable digits). |
The new IDs are defined as the combination of the
fixed characters and the variable number increased by 1 for each new
assignation. The procedure stops if the numerical part goes over the limit
corresponding to the number of specified digits.
3 – Addition of objects
Before any addition with an alpha ID, the application checks if the structure
of the last record corresponds to the definition given by the user (total width
and numeric part width)
Before any addition, the application checks if the specified table is
still accessible (open); if not, the user must redefine his choices (table,
type, column).
As the objects are inserted in the specified table (Insert into …) that
table does not have to be editable. Furthermore, the graphic data collected by
the tool cursor is converted to the addition table coordinate system. Nothing
forbids thus using the tool in a mapper that does not
contain the addition table. Nothing requires that the addition table be
visible; it must simply be open.
Use one of the 4 available icons. The styles of the
added objects are those that are current and can be changed at any time by the
style buttons.
Checks during additions:
Integer: none. If the ID exceeds the maximum
acceptable for that type of variable, there will be a system error.
Smallint:
the addition procedure is stopped by the program if the ID exceeds the maximum
acceptable for that type of variable
Alpha: the addition procedure is stopped by the
program if the value of the numeric part of the ID exceeds the maximum possible
for the specified number of digits
4 – End of additions
It is left to the user to save the modified table.
The “add object” icons remain accessible until the
user starts defining a new table (via menu or icon) and cancels that procedure.
Menu and toolbar can be removed by using the menu item
“Remove …”