Example #1
0
require_once "api_conversion.php";
$fields = array(array("bool", DBFFIELD_TYPE_LOGICAL), array("memo", DBFFIELD_TYPE_MEMO), array("date", DBFFIELD_TYPE_DATE), array("number", DBFFIELD_TYPE_NUMERIC, 3, 0), array("string", DBFFIELD_TYPE_CHAR, 50));
$di = dbase_create("test/dbase.dbf", $fields);
$xi = xbase_create("test/xbase.dbf", $fields);
dbase_add_record($di, array("T", "abc", "20060120", 123, "string one"));
dbase_add_record($di, array("F", "def", "20060121", 321, "string two"));
dbase_add_record($di, array("F", "ghi", "20060121", 111, "string trio"));
xbase_add_record($xi, array("T", "abc", "20060120", 123, "string one"));
xbase_add_record($xi, array("F", "def", "20060121", 321, "string two"));
xbase_add_record($xi, array("F", "ghi", "20060121", 111, "string trio"));
dbase_close($di);
xbase_close($xi);
$di = dbase_open("test/dbase.dbf", 2);
$xi = xbase_open("test/xbase.dbf", 2);
dbase_delete_record($di, 2);
xbase_delete_record($xi, 2);
dbase_pack($di);
xbase_pack($xi);
dbase_close($di);
xbase_close($xi);
$di = dbase_open("test/dbase.dbf", 2);
$xi = xbase_open("test/xbase.dbf", 2);
echo "dbase<br>";
echo "index = {$di} <br>";
echo "<br>";
echo "xbase<br>";
echo "index = {$xi} <br>";
echo "header info: ";
print_r(xbase_get_header_info($xi));
dbase_close($di);
xbase_close($xi);
function dbase_delete_record($dbase_identifier, $record_number)
{
    return xbase_delete_record($dbase_identifier, $record_number);
}