reference/dbase/functions/dbase-create.xml
4754397753fd79f1c846868b66a2448babab1c54
...
...
@@ -8,15 +8,17 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>int</type><methodname>dbase_create</methodname>
12
-
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
11
+
<type>resource</type><methodname>dbase_create</methodname>
12
+
<methodparam><type>string</type><parameter>path</parameter></methodparam>
13
13
<methodparam><type>array</type><parameter>fields</parameter></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>DBASE_TYPE_DBASE</initializer></methodparam>
14
15
</methodsynopsis>
15
16
<para>
16
17
<function>dbase_create</function> creates a dBase database with the given
17
18
definition.
19
+
If the file already exists, it is not truncated.
20
+
<function>dbase_pack</function> can be called to force truncation.
18
21
</para>
19
-
&note.sm.uidcheck;
20
22
&note.open-basedir.func;
21
23
</refsect1>
22
24
<refsect1 role="parameters">
...
...
@@ -24,10 +26,10 @@
24
26
<para>
25
27
<variablelist>
26
28
<varlistentry>
27
-
<term><parameter>filename</parameter></term>
29
+
<term><parameter>path</parameter></term>
28
30
<listitem>
29
31
<para>
30
-
The name of the database. It can be a relative or absolute path to
32
+
The path of the database. It can be a relative or absolute path to
31
33
the file where dBase will store your data.
32
34
</para>
33
35
</listitem>
...
...
@@ -38,7 +40,9 @@
38
40
<para>
39
41
An array of arrays, each array describing the format of one field of the
40
42
database. Each field consists of a name, a character indicating the field
41
-
type, and optionally, a length, and a precision.
43
+
type, and optionally, a length, a precision and a nullable flag.
44
+
The supported field types are listed in the <link
45
+
linkend="intro.dbase">introduction section</link>.
42
46
</para>
43
47
<note>
44
48
<para>
...
...
@@ -47,16 +51,56 @@
47
51
</note>
48
52
</listitem>
49
53
</varlistentry>
54
+
<varlistentry>
55
+
<term><parameter>type</parameter></term>
56
+
<listitem>
57
+
<para>
58
+
The type of database to be created. Either
59
+
<constant>DBASE_TYPE_DBASE</constant> or
60
+
<constant>DBASE_TYPE_FOXPRO</constant>.
61
+
</para>
62
+
</listitem>
63
+
</varlistentry>
50
64
</variablelist>
51
65
</para>
52
66
</refsect1>
53
67
<refsect1 role="returnvalues">
54
68
&reftitle.returnvalues;
55
69
<para>
56
-
Returns a database link identifier if the database is successfully created,
70
+
Returns a database resource if the database is successfully created,
57
71
or &false; if an error occurred.
58
72
</para>
59
73
</refsect1>
74
+

75
+
<refsect1 role="changelog">
76
+
&reftitle.changelog;
77
+
<informaltable>
78
+
<tgroup cols="2">
79
+
<thead>
80
+
<row>
81
+
<entry>&Version;</entry>
82
+
<entry>&Description;</entry>
83
+
</row>
84
+
</thead>
85
+
<tbody>
86
+
<row>
87
+
<entry>dbase 7.0.0</entry>
88
+
<entry>
89
+
The <parameter>type</parameter> parameter has been added.
90
+
</entry>
91
+
</row>
92
+
<row>
93
+
<entry>dbase 7.0.0</entry>
94
+
<entry>
95
+
The return value is now a <type>resource</type> instead of an
96
+
<type>int</type>.
97
+
</entry>
98
+
</row>
99
+
</tbody>
100
+
</tgroup>
101
+
</informaltable>
102
+
</refsect1>
103
+

60
104
<refsect1 role="examples">
61
105
&reftitle.examples;
62
106
<para>
63
107