Re: problems with the scoping in eu4
- Posted by jimcbrown (admin) Jan 07, 2011
- 2068 views
jaygade said...
I think that the complaint is persistence from iteration to iteration. The variable is either unassigned, or it is reassigned some default value on every new iteration of the loop.
The simple example initially given was a good one, trying to use two counters in one loop.
If persistence from iteration to iteration is allowed, you'd need to do this:
while 1 do integer i if not object(i) then i = 0 end if i += 1 end while
Which may not be a bad thing.