Here is a patch file with my patches to fix both problems in ThinkDB.pm (floating point, Categories):
--- /opt/local/lib/perl5/site_perl/5.16.3/Palm/original/ThinkDB.pm 2001-06-12 15:11:10.000000000 -0500
+++ /opt/local/lib/perl5/site_perl/5.16.3/Palm/original/fixed/ThinkDB.pm 2015-01-21 11:31:58.000000000 -0600
@@ -107,11 +107,12 @@
# Unpack a record
my $foo;
- my ($type, $id) = unpack "CxN", $data;
+ my ($type, $cat, $id) = unpack "CCN", $data;
_debug_printf(" type: %d id: %d\n", $type, $id);
$data = substr $data, 6;
$record{idnum} = $id;
+ $record{category} = $cat;
if ($id > $self->{high_id}) {
$self->{high_id} = $id;
}
@@ -145,7 +146,7 @@
}
# Float
elsif ($ctype == 4) {
- my (@val) = unpack("s2", $data);
+ my (@val) = unpack("f>", $data);
_debug_printf(" col: %02d data: %s\n", $cid, join(',', @val));
$record{col}{$cid} = $val[0];
$record{raw}{$cid} = substr $data, 0, 4;
@@ -291,7 +292,7 @@
$record->{idnum} = ++$self->{high_id};
}
- $retval = pack("CxN", 87, $record->{idnum});
+ $retval = pack("CCN", 87, $record->{category}, $record->{idnum});
foreach my $field (sort { $a <=> $b } keys %{$record->{col}}) {
$ctype = $self->{cols}[$field]{type};
@@ -311,6 +312,11 @@
elsif ($ctype == 3) {
$retval .= pack("N", $record->{col}{$field});
}
+ #Float
+ elsif ($ctype == 4) {
+ $retval .= pack("f>", $record->{col}{$field});
+ }
+
# List
elsif ($ctype == 5) {
$retval .= pack("C", $self->list_lookup($field, $record->{col}{$field}));
Show quoted text> On Jan 20, 2015, at 10:29 PM, Bugs in Palm-ThinkDB via RT <bug-Palm-ThinkDB@rt.cpan.org> wrote:
>
>
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
> "Categories not being transmitted to output file",
> a summary of which appears below.
>
> There is no need to reply to this message right now. Your ticket has been
> assigned an ID of [rt.cpan.org #101649]. Your ticket is accessible
> on the web at:
>
>
https://rt.cpan.org/Ticket/Display.html?id=101649
>
> Please include the string:
>
> [rt.cpan.org #101649]
>
> in the subject line of all future correspondence about this issue. To do so,
> you may reply to this message.
>
> Thank you,
> bug-Palm-ThinkDB@rt.cpan.org
>
> -------------------------------------------------------------------------
> ThinkDB.pm does not deal properly with Categories as defined by Smart-List-To-Go (SLTG). SLTG category codes are included in the data records, for record type 87. They are not found in the record index block. ThinkDB.pm is ignoring the category code values in the data records. The category code follows right after the record type, in the data record (for record type 87).