Skip to content

index of table #40

@qgenesist

Description

@qgenesist

I am on Lua 5.1 windows 64 bit.

I am using only this.
local serpent = require('serpent')
savF(_fp, (serpent.block(_famOBJ)))

savF simply writes the data from serpent.block to the file pointed to by _fp, and _famOBJ is my table that I want to save.
I use plugins in a program that is genealogy. The tables I will serialize are only 3 types.
'flat' tables.
tables within tables ... tables
perhaps function tables

the issue I am facing and either do not understand the options, or they dont exist is:

when I select a few random samples to send to your file in an indexed table it works fine I chose a run of 5 tables, indexed by 3, 5, 23, 30, 63 :

{
[3] = {
CHIL = {
{
BIRTH = "1980",
DEATH = " ",
ERA = "(1980 - )",
famc = {
{
fby = "",
fID = 3,
fpa = ""
} --[[table: 07CC8AC8]],
{
fby = "HUSB",
fID = 2314,
fpa = "ADOP"
} --[[table: 07CCB020]]
} --[[table: 07CD8018]],

the indexes to those individual tables [3] = and so on, are the family number which I will need for retrieval, brilliant, this is working and precisely the serialization I need.

Then, I choose the first 500 entries in my table, which do start at [1], and are sequential for quite a while, but are not actually sequential in the whole. The result.

{
{
CHIL = {
{
BIRTH = "1964",
DEATH = " ",
ERA = "(1964 - )",
famc = {
{
fby = "",
fID = 1,
fpa = ""
} --[[table: 07CD5FC0]]
} --[[table: 07CD0700]],
fams = {
{
DDAT = "",
fID = 56,
MDAT = "9 Jun 1984"
} --[[table: 07CD7988]]
} --[[table: 07CD6100]],

the indexing is gone, with exactly the same call to serpent.
I need to force that indexing, and as you may remember me from Zerobrane, I lack the requisite knowledge to do so.

HELP!!!!
Thank you Paul.

Ron Melby

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions