diff options
author | itsme <itsme@xs4all.nl> | 2021-07-13 23:26:22 +0200 |
---|---|---|
committer | itsme <itsme@xs4all.nl> | 2021-07-13 23:26:22 +0200 |
commit | d3582ac336721b65e988f6ca1b7dd0b4310a2a6c (patch) | |
tree | 4cb531f6b499bfa05cefb554f1cc6b7b6f2b12b1 | |
parent | 40b8b1b16a50360f6a6cbd7a65198f0414ce98bf (diff) |
-rw-r--r-- | crodump.py | 2 | ||||
-rw-r--r-- | dumpdbfields.py | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -455,7 +455,7 @@ class Database: | |||
455 | for i in range(self.nrofrecords()): | 455 | for i in range(self.nrofrecords()): |
456 | data = self.bank.readrec(i+1) | 456 | data = self.bank.readrec(i+1) |
457 | if data and data[0] == table.tableid: | 457 | if data and data[0] == table.tableid: |
458 | yield data[1:].split(b"\x1e") | 458 | yield i+1, data[1:].split(b"\x1e") |
459 | 459 | ||
460 | 460 | ||
461 | def recdump(self, args): | 461 | def recdump(self, args): |
diff --git a/dumpdbfields.py b/dumpdbfields.py index 131cfa3..5de925d 100644 --- a/dumpdbfields.py +++ b/dumpdbfields.py | |||
@@ -20,8 +20,10 @@ def main(): | |||
20 | tab.dump(args) | 20 | tab.dump(args) |
21 | print("nr=%d" % db.nrofrecords()) | 21 | print("nr=%d" % db.nrofrecords()) |
22 | i = 0 | 22 | i = 0 |
23 | for rec in db.enumerate_records(tab): | 23 | for sysnum, rec in db.enumerate_records(tab): |
24 | # beware to skip tab.fields[0], which is the 'sysnum' | 24 | # beware to skip tab.fields[0], which is the 'sysnum' |
25 | # since the rec does not include the sysnum. | ||
26 | print(">> %s -- %s" % (tab.fields[0], sysnum)) | ||
25 | for field, fielddef in zip(rec, tab.fields[1:]): | 27 | for field, fielddef in zip(rec, tab.fields[1:]): |
26 | print(">> %s -- %s" % (fielddef, asasc(field))) | 28 | print(">> %s -- %s" % (fielddef, asasc(field))) |
27 | i += 1 | 29 | i += 1 |