Code: Select all
OpenFile(1, "t:table.bin", #MODE_READ)
newtable = ReadTable(1)
CloseFile(1)
Function p_iteratelist(table)
Local counter = 0
If(HaveItem(table,"stations"))
counter = TableItems(table.stations)
DebugPrint("Stations: "..counter)
If(counter> 0)
For i,v In IPairs(table.stations)
DebugPrint("i: "..i)
ForEach(v, DebugPrint)
DebugPrint("Open: "..HaveItem(v,"isOpen"))
DebugPrint("PLZ: "..HaveItem(v,"postCode"))
Next
EndIf()
Else
counter = 0
EndIf()
EndFunction
p_iteratelist(newtable)
Code: Select all
Und Action!
Stations: 6
i: 0
brand Freie Tankstelle
isOpen 1
postCode 48653
dist 0.2
place Coesfeld
lat 51.94431
street Münsterstraße
lng 7.1713185
name City Tank Coesfeld
id bc7702f4-9ddb-4d3f-b4c8-7a9f5e3eca25
price 1.409
houseNumber 53
Open: 0
PLZ: 0
i: 1
brand STAR
isOpen 1
postCode 48653
dist 0.9
place Coesfeld
lat 51.93744
street Dülmener Straße
lng 7.167851
name star Tankstelle
id 005056ba-7cb6-1ed2-bceb-b34cf7408d48
price 1.409
houseNumber 22
Open: 0
PLZ: 0
i: 2
brand freie Tankstelle
isOpen 1
postCode 48653
dist 1.2
place Coesfeld
lat 51.934755
street Dülmener Str.
lng 7.168276
name Stefan von Bronk
id 302db304-457a-42b6-c9d6-55271cfe7d8b
price 1.409
houseNumber 42
Open: 0
PLZ: 0
i: 3
brand Westfalen
isOpen 1
postCode 48653
dist 0.9
place Coesfeld
lat 51.95288
street Holtwicker Str.
lng 7.16396
name Sascha Trieburg
id 9d5ad5db-6db4-41d2-8a1d-6745d5002ff1
price 1.419
houseNumber 31
Open: 0
PLZ: 0
i: 4
brand Westfalen
isOpen 1
postCode 48653
dist 1
place Coesfeld
lat 51.93675
street Dülmener Str.
lng 7.16796
name Sascha Triburg
id b985be53-5be2-4a2e-b0f4-cf8c03fc3881
price 1.419
houseNumber 24-26
Open: 0
PLZ: 0
i: 5
brand Q1
isOpen 1
postCode 48653
dist 1.7
place Coesfeld
lat 51.9351
street Rekener Straße
lng 7.15223
name Q1 Tankstelle
id b67bdf8b-a03a-4f26-abb4-f99eff80e1a3
price 1.419
houseNumber 92
Open: 0
PLZ: 0
How come the table the check for the columns gives 0, whereas the DebugPrint finds these values?