|
CreateTable() 
Create a database (DBF) table in the currently
open company folder.
Syntax
CreateTable(<cFilename>, <aFields>,
<aFldTypes>, <aFldLengths>,
<aFldDecimals>)
Arguments
<cFilename> --> The name of the database
file to create. This file name cannot contain any path information
and must be no greater than 8 characters in length.
<aFields> --> An array containing a list
of field names. Each field name must be defined as a string no
greater than 10 characters wide.
<aFldTypes> --> An array containing a
list of field types. Valid field types include strings "C"
(character type), dates "D" (date type) and numbers "N" (numeric
type).
<aFldLengths> --> An array containing a
list of field lengths. Valid field lengths must consist of numeric
values greater than zero and less than 1025.
If fields are created with a length greater
than 255 they will not be compatible with the generic DBF format
and may not be readable or correctly read, by external
applications.
<aFldDecimals> --> An array containing a
list of field decimal places. Valid field decimals must consist of
numeric values greater than zero and less than 253. If the field
type is not numeric, the field decimal must be zero. The field
decimal must also be at least 2 numbers less than the field
size.
Returns
Returns logical TRUE if the table was
successfully created, otherwise logical FALSE.
Description
This function creates an empty database (DBF)
table.
Examples
Creates a database table consisting of 2
character fields and one numeric field:
CreateTable(
"MyTable", { "Tom", "Dick", "Harry" }, { "C", "C", "N" }, { 10, 10,
12 }, { 0, 0, 2 } )
This
function has been designed for advanced users and programmers. Be
careful when specifying the filename as this function will
automatically erase and replace any existing table with a matching
name.
____________________________
Related Topics
Business
Function List
|