Hi all,
I need to make an infinite loop with Do function
Anyone can help me?
Thank you
Another simple thing While[True, ... ] construct:
While[True, ... ]
n = 1; While[True, Pause[1]; Print[n]; n++]
The Infinity spec should work:
Infinity
Do[expr, Infinity]
See http://reference.wolfram.com/language/ref/Do.html#489332529,
Do[expr,Infinity] continues evaluating expr until explicitly told to exit through a function such as Break, Return, Throw, Abort, or Quit.
I imagine verifying it will actually iterate to Infinity would have presented some testing challenges :-)
The latest version 11.2.0 allows this:
Dynamic[i] Do[i, {i, Infinity}]
But for what purpose do you need it?