Maptitude GISDK Help

ModifyTable()

Summary

Modifies the file structure of a dBASE, fixed-format text, or fixed-format binary table.

 

Changes

In Version 2013 added field types "Date", "Time", and "DateTime."

 

Syntax

ModifyTable(string view_name, array field_info_array)

 

Argument Contents
view_name Name of an open table; if null, the current view is used
field_info_array An array with one element for each field in the modified table, where each element is an array as follows:

 

Element Type Contents
1 String Modified field name
2 String Field type - "Integer" (long integers), "Real" (double-precision floating point numbers), "String", "Short" (short integers), "Tiny" (one-byte integers), "Float" (single-precision floating point numbers), "Date" (4-byte date), "Time" (4-byte time), or "DateTime" (8-byte date and time)
3 Integer Internal field width
4 Integer Number of decimals
5 Boolean Whether or not the field should be internally (permanently) indexed
6 String Field format; ignored for dBASE tables and string fields of non-dBASE tables
7 Array of arrays The aggregation rules for the field; each rule is in a subarray
8 String A description of the field
9 Same as field type The default value
10 Array Aggregation rule when joining/splitting features for geographic editing
11 String The display name
12 String Original field name; null if a new field

 

Notes

Example

// First open customer.dbf in the Tutorial folder for exclusive access

view_name = GetView()

strct = GetTableStructure(view_name, {{"Include Original", "True"}})

// Add a field for 2002 Sales data

strct = strct + {{"Sales2000", "Real", 12, 2, "True", , , , , , , null}}

// Modify the table

ModifyTable(view_name, strct)

Error Codes

Error Type Meaning
Error Field_info_array is null or invalid; the table is not modifiable because it is read-only, part of a joined view, or not a dBASE, fixed-format text, or fixed-format binary table; or a file I/O error occurred that prevented rewriting of some files, (e.g., the user does not have write access, some files are in use, or there is not enough disk space for temporary files)
NotFound The named view does not exist, or table_name is null and there is no current view

 

See Also

Function Summary
CreateTable() Creates an empty table and opens it as a view
GetFieldAggregations() Gets the aggregation rules for a field
GetFieldDescription() Gets the description of a field
GetTableModifyFlag() Tests whether a table can be modified by ModifyTable()
GetTableStructure() Gets a list and description of the fields in a table

 

 

©2025 Caliper Corporation www.caliper.com