My problem got simplified after a few days of tearing my hair out (left the important bits only, refer to my many edits for history), here it is:
showmessage('i='+inttostr(i));
for i in [2..5,8,11..13] do
showmessage('1');
showmessage('i='+inttostr(i));
this is placed in a unit in my program of random fiddling with delphi. I think I should note that non-continuous for-in loop ranges work in the program elsewhere (another unit). In total, I have two such non-continuous for-in loops
in the same procedure, if I comment out one the other works fine, but if they're both in working condition at the same time, only the second one works, the first one behaves like described below.
First messagebox contains "i= random-number" as it's not initialized, not that it needs to be. Messagebox with "1" in it never appears. Second messagebox that appears has "i=14", meaning that the loop did trigger but didnt do anything? That's ridiculous, if not, I want two things if someone can enlighten me:
1) why is this happening?
2) how to fix it and avoid in the future?