Gio_S
Guest
Bye to all,
I'm going crazy with the "while"
I declare the condition, in my case reading a file, but cmq the problem is generic on every instruction that you want to treat in a while cycle.
the condition for performing the loop instructions is that, exemplify, the word "finefile" is not read.
but when, in the loop, it is read "finefile", the execution does not jump at all out, and tries to perform the same the next instructions contained in the loop, with a lot of reading error beyond the end of the file.
the stop only happens to the next cycle.
I have made up, but brutally, in the sense that at the top of the instructions provided by the loop I tell him to execute them (with an additional if) only if the previously read word is not "finefile".
I mean, I have to put two blocks.
In practice, at the face of the while, the loop is performed to complete one last time. Oh, my God, it's not done, but just because I even planted a if to blow up the instructions left in the cycle.
I don't think I've been very clear ... in practice the while cycles are run to complete the instructions even if they break the condition placed in the while.
is there not a more elegant way to get out of the loop to the flight, than to place even a if, to avoid this last cycle already started?
thank you very much if I managed to explain and someone enlightens me!
g.
I'm going crazy with the "while"
I declare the condition, in my case reading a file, but cmq the problem is generic on every instruction that you want to treat in a while cycle.
the condition for performing the loop instructions is that, exemplify, the word "finefile" is not read.
but when, in the loop, it is read "finefile", the execution does not jump at all out, and tries to perform the same the next instructions contained in the loop, with a lot of reading error beyond the end of the file.
the stop only happens to the next cycle.
I have made up, but brutally, in the sense that at the top of the instructions provided by the loop I tell him to execute them (with an additional if) only if the previously read word is not "finefile".
I mean, I have to put two blocks.
In practice, at the face of the while, the loop is performed to complete one last time. Oh, my God, it's not done, but just because I even planted a if to blow up the instructions left in the cycle.
I don't think I've been very clear ... in practice the while cycles are run to complete the instructions even if they break the condition placed in the while.
is there not a more elegant way to get out of the loop to the flight, than to place even a if, to avoid this last cycle already started?
thank you very much if I managed to explain and someone enlightens me!
g.

