[solved] TIniFile takes first value for repeated key lazarus / 64-FPC development ---------------------------------------------------------------------- kegge13 · 2020-06-04 07:46 When a key in a ini file has more than one version, Delhi would take the last value. FPC 3.0.4 takes the first value. Not a big deal, I tend to have multiple versions of a key for quick testing, but was this a deliberate design change? In IniFiles ReadString uses KeyByName to find a key: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i       for i := 0 to Count-1 do        if CompareText(Items[i].Ident, AName) = 0 then begin          Result := Items[i];          Break;  Btw: imho using a break in a for-loop is a sloppy programming practice. Is that because of my old-skool background? ---------------------------------------------------------------------- PascalDragon · 2020-06-04 08:08 Quote from: kegge13 on June 04, 2020, 09:46:38 amBtw: imho using a break in a for-loop is a sloppy programming practice. Is that because of my old-skool background? Yes. Using Break is perfectly legitimate and more often than not it's better to abort a loop early (e.g. if you search for a value in a large dataset why walk the whole list when you can abort early?). ---------------------------------------------------------------------- howardpc · 2020-06-04 08:31 Quote from: kegge13 on June 04, 2020, 09:46:38 amWhen a key in a ini file has more than one version, Delhi would take the last value. FPC 3.0.4 takes the first value. Not a big deal, I tend to have multiple versions of a key for quick testing, but was this a deliberate design change? FPC has deliberately been implemented without reference to Delphi code.To provide - as far as possible - compatibility with Delphi, its published APIs and documentation are of course consulted, but not the sources, which are copyright. So a clean-room approach is taken, and FPC sources are not derived from Delphi except for (largely) compatible naming/API and functionality. Implementation specifics are consequently bound to differ from Delphi (if you have the Delphi sources and compare them, which many FPC users don't). ---------------------------------------------------------------------- kegge13 · 2020-06-04 08:46 Quote from: PascalDragon on June 04, 2020, 10:08:47 amYes. Using Break is perfectly legitimate and more often than not it's better to abort a loop early (e.g. if you search for a value in a large dataset why walk the whole list when you can abort early?). Therefore I would have used a while loop. But I see your point, which I always was aware of, it takes one test extra each loop: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i while (i