From c261a1504187850c4e8ac6802d7815605a977ff5 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Mon, 16 Jun 2025 11:29:48 +0200 Subject: [PATCH] Parse field repetition count --- fmp/fmp_table.go | 2 ++ fmp/fmp_test.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/fmp/fmp_table.go b/fmp/fmp_table.go index cccce24..305d75e 100644 --- a/fmp/fmp_table.go +++ b/fmp/fmp_table.go @@ -13,6 +13,7 @@ type FmpColumn struct { DataType FmpDataType StorageType FmpFieldStorageType AutoEnter FmpAutoEnterOption + Repetitions uint8 Indexed bool } @@ -44,6 +45,7 @@ func (ctx *FmpFile) Tables() []*FmpTable { Type: FmpFieldType(flags[0]), DataType: FmpDataType(flags[1]), StorageType: FmpFieldStorageType(flags[9]), + Repetitions: flags[25], Indexed: flags[8] == 128, } diff --git a/fmp/fmp_test.go b/fmp/fmp_test.go index 57776ae..1d7536b 100644 --- a/fmp/fmp_test.go +++ b/fmp/fmp_test.go @@ -58,6 +58,9 @@ func TestTables(t *testing.T) { if field.StorageType != FmpFieldStorageRegular { t.Errorf("expected field storage type to be regular, but it is not") } + if field.Repetitions != 1 { + t.Errorf("expected field repetition count to be 1, but it is %d", field.Repetitions) + } if !field.Indexed { t.Errorf("expected field to be indexed, but it is not") }