Error -nan(ind).000000 again

Sorry to replicate this topic but I really do not know how to solve my problem: I have two doubles - d1 and d2 - that are computed in a loop. The values are recurrently computed if, for example, d1 + d2 is lower than, say, 100 or greater than 200. But because d1 + d2 = -nan(ind).000000, when both d1 and d2 are numeric, the software runs out the loop and I do not get a correct value, say 122.

Can you provide a link to the thread you are talking about ? That would help figuring out what you talk about.

Al so providing Xojo version and the part of the code that fails would be useful.

Thanks Gilles. The code is really in a thread but I do not know how to provide a link. I am working on Xojo 2017r3. But I just installed Xojo 2021r2 for testing. The code is very simple:

while DOUBLE1 < MINIMUM or DOUBLE1 > MAXIMUM
DOUBLE1 = DOUBLE1 - DOUBLE2
DOUBLE2 = grnGeneration(varE(iev)) A FUNCTION TO GENERATE A RANDOM VALUE
DOUBLE1 = DOUBLE1 + DOUBLE2
wend

After sometime in the loop I notice that both doubles are numeric but the result from summing the value is non numeric. Then, my software runs out the loop with a non numeric value for double1.

The problem also occurs with Xojo 2021. See the output:
Sim. Gen. Env. Ind. A D Env. GxE P
1 1 1 1 24.303883 -1.091594 924.755615 35.147602 -nan(ind).000000
1 1 1 2 24.303883 -1.091594 924.755615 35.147602 -nan(ind).000000
1 1 1 3 -29.751881 3.764169 1799.738525 134.347839 -nan(ind).000000
1 1 1 4 -29.751881 3.764169 1799.738525 134.347839 -nan(ind).000000

I found the problem thanks