mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@206717 c90b9560-bf6c-de11-be94-00142212c4b1
111 lines
2.4 KiB
XML
111 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<!-- splitted from ./en/functions/paradox.xml, last change in rev -->
|
|
<refentry id="function.px-new">
|
|
<refnamediv>
|
|
<refname>px_new</refname>
|
|
<refpurpose>Create a new paradox object</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>resource</type><methodname>px_new</methodname>
|
|
<void />
|
|
</methodsynopsis>
|
|
<para>
|
|
Create a new paradox object. You will have to call this function before any
|
|
further functions. <function>px_new</function> does not create any file on
|
|
the disk, it just creates an instance of a paradox object. This function
|
|
must not be called if the object oriented interface is used.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns &false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Opening a Paradox database</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
if(!$pxdoc = px_new()) {
|
|
/* Error handling */
|
|
}
|
|
$fp = fopen("test.db", "r");
|
|
if(!px_open_fp($pxdoc, $fp)) {
|
|
/* Error handling */
|
|
}
|
|
// ...
|
|
px_close($pxdoc);
|
|
px_delete($pxdoc);
|
|
fclose($fp);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
If you prefer the object oriented API, then the above example will look
|
|
like the following.
|
|
<example>
|
|
<title>Opening a Paradox database</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fp = fopen("test.db", "r");
|
|
$pxdoc = new paradox_db();
|
|
if(!$pxdoc->open_fp($fp)) {
|
|
/* Error handling */
|
|
}
|
|
// ...
|
|
$pxdoc->close();
|
|
fclose($fp);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>px_delete</function></member>
|
|
<member><function>px_open_fp</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|