I am trying to get a loop structure using While
to repeatedly evaluate another cell referred to in its body (using a cell tag).
"this is the while construct";
x = 2;
y = 5;
While[x < y,
NotebookLocate["code"];
FrontEndTokenExecute["EvaluateCells"];
x
y
]
and this is the cell called "code"
"this cell contains the code i want to run";
x = x + 0.1;
y = y - 0.1;
My code seems to enter an endless loop.
What I expected was when the two numbers, x and y, became equal, the loop would stop. What am I doing wrong?