Posted: Sun Sep 29, 2002 11:39 am
Restored from previous forum. Originally posted by tinman.
Besides, just because it is used in C and Windows, who is to say it is the correct way to code?
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.30)
Yes, but as shown in the complete example by MrVain, you stick an If round the part you are doing as the main loop and only do that if you have not already forced an end of loop.Originally posted by Justin
If the idea is this:
For a=1 To 999
messagerequester("",str(a),0)
if a=5 : a=999 : endif ;trying to break
messagerequester("","loop complete",0)
Next
messagerequester("","loop exit",0)
That is not a break, 'loop complete' is executed after forcing a=999, the loop is always finished,
There is very rarely only one way of doing something.a break transfers control inmediately to the statement following the next, endselect or whatever. Everything between the break and the next is not executed, the only way is using a goto.
Yes, but in C the only clean way to get out of a switch statement is to use break. Otherwise the program just runs through all the code inside the "case XXXX:" parts.The break is extensively used in the windows message loop, look at any c code.
Besides, just because it is used in C and Windows, who is to say it is the correct way to code?
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.30)