.ini file iterator returning wrong value for repeated keys

Say you have an ini file like this:[Section]Key=Value1Otherkey=fooKey=Value2And you iterate over this with nested ini file iterators assigning to variables %key% and %value%, you’ll get these %key%/%value% pairs:Key/Value1Otherkey/fooKey/Value1I don’t know if repeated keys are technically valid, but they sure are handy :slight_smile: (if they worked correctly :))Steve

Steve,

FYI: INI keys must be unique. If there is more that one key, then when retrieving the value associated with that key, the first listed value is returned. This is standard INI behavior.

The 2 easiest solutions are use unique keys (Key1, Key2, etc) or use a CSV line on a single key (ie Key=Value1,Value2,etc)

I understand that they should be unique when requesting a value, but FB is actually happy to iterate over repeated values - it just returns the wrong key value.

I know that I’m horribly abusing what .ini files are for, I’m actually using .ini syntax to write a quasi programming language. I’ll use the first solution above…

Steve

Hi Steve,

If you want that kind of expressability, you may want to look into creating a simple XML file. XML with XPath is perfect for this kind of thing. FinalBuilder has solid support for these technologies, as well.

- Angus