NAME
XBase::Index - base class for the index files for dbf
if ($indexfile->{'active'}{'key_type'} eq 'N')
{
my $f = substr $key, 0, 8;
my $exp = substr $key, 8, 2;
print "$key $f $exp\n";
$f = unpack 'V', $f;
$exp = unpack 'v', $exp;
print "$key $f $exp\n";
$f &= 0xfffffffffffff;
$exp >>= 4;
print "$key $f $exp\n";
print "$key $f $exp\n";
$f = pack 'V', $f;
$exp = pack 'v', $exp;
print "$key $f $exp\n";
exit;
my $bigend = substr(pack( "d", 1), 0, 2) eq '?ð';
if ($bigend)
{
$key = reverse $key if $bigend;
### $key = unpack "d", $key;
}
}
SYNOPSIS
use XBase;
my $table = new XBase "data.dbf";
my $cur = $table->prepare_select_with_index("id.ndx",
"ID", "NAME);
$cur->find_eq(1097);
while (my @data = $cur->fetch())
{
last if $data[0] != 1097;
print "@data\n";
}
This is a snippet of code to print ID and NAME fields from dbf data.dbf where ID equals 1097. Provided you have index on ID in file id.ndx.
DESCRIPTION
This is the class that currently supports ndx index files. The name will change in the furute as we later add other index formats, but for now this is the only index support.
The support is read only. If you update your data, you have to reindex using some other tool than XBase::Index currently. Anyway, you have the tool to do that because XBase::Index doesn't support creating the index files either. So, read only.
I will stop documenting here for now because the module is not finalized and you might think that if I write something in the man page, it will stay so. Most probably not ;-) Please see eg/use_index in the distribution directory for more information.
VERSION
0.0942
AUTHOR
(c) 1998 Jan Pazdziora, adelton@fi.muni.cz
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 461:
Unknown directive: =comment
- Around line 488:
Non-ASCII character seen before =encoding in ''?ð';'. Assuming CP1252