Maptitude GISDK Help

CreateTable()

Summary

Creates an empty table and opens it as a view.

 

Changes

In Version 2013 added field types "Date", "Time", and "DateTime." In Version 2016 added MEM class and optional field_info_array elements 5 and 6. Added optional eighth element to field_info_array in Version 2018.

 

Syntax

new_view_name = CreateTable(string view_name, string filename, string class, array field_info_array)

 

Argument

Contents

view_name

Desired name for the new view

filename

File name for the new table

class

Class of new table to create (dBASE, FFA, FFB, CSV, or MEM)

field_info_array

An array that contains one element for each field in the new table, where each element is an array defined as:

 

Element

Type

Contents

1

String

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

Field width

4

Integer

Number of decimals; can be null (defaults to zero)

5 (optional)

Boolean

A flag indicating whether the field should be internally (permanently) indexed; the default is "False"

6 (optional)

String

Description of the field

7 (optional)

Same type as field

The default value of the field

8 (optional)

String

The display format of the field, see Format()

 

Returns

A string containing the name of the view.

 

Notes

Example

employees = CreateTable("Employees", "employee.dbf", "DBASE", {

     {"LNAME", "String", 16, null, "Yes"},

     {"FNAME", "String", 12, null, "No"},

     {"PAYRATE", "Real", 12, 2, "No"},

     {"ID", "Integer", 8, null, "Yes"}

     })

 

Error Codes

Error Type

Meaning

Error

Input view_name, filename, class or field_info_array is null; or

input class is not one of the supported classes; or

field_info_array has a wrong format; or

a file I/O error occurred (e.g., out of disk space); or

the user does not have file access, or some of the new files would overwrite an existing file in use

 

See Also

Function

Summary

OpenTable()

Opens a table from a file on disk and creates a view

GetViewStructure()

Retrieves a listing and description of the fields in a view

 

 

©2025 Caliper Corporation www.caliper.com