Deluge Sequence

Deluge Sequence

I just encountered something that baffles me trying to use Alerts to inspect the values of variables. The order of my Alerts appear exactly in reverse order. Does anyone know why this would be? To verify, I created a simple one-button stateless form and added this code to the button click:

alert "this should happen first";
x = 1;
for each myRec in Customers[ID > 0]
{
alert x;
x = x + 1;
}

With 3 records in my Customers form, the first Alert said "3", the second Alert said "2", the third Alert said "1", and the last Alert said "this should happen first".

That seems completely backwards from what I expected. It is like the Alerts are all put in a stack and then presented back to me in a last-in-first-out (LIFO) order. At least I hope that is what is happening.

Is this really the way Alerts work or what am I missing?