I think this behavior is counter intuitive, but may be normal behavior (I don't know). I've seem this in the past and I think that preceding loads cannot be used together with autogenerate/while statements.
For example if you modify the code to do the following, QV will loop forever:
LOAD recno() as ID, rowno() as Test
while RowNo() <=5;
however, if you remove the preceding load from any of the examples, it will work as expected,
After reading an explanation about how preceding load works, I think the result you have is because in preceding load the process of each record takes place in each iteration, so RowNo() is always its first value for each iteration.
This is the explanation I think it is the most accurate:
Let's say that you have the following construction:
Load *, SomeFunction(X,Y) as Z; // Load statement "B"
Load X, Y From ... ; // Load statement "A"
Then each record that is loaded by "A" is piped into "B". This means that "B" processes the first record completely before "A" starts to process the second record. In other words: the result of "A" is never stored as a table - neither on disk, nor in RAM. So you can't say that "B" loads a table from RAM or from disk.