jeudi 2 avril 2015

IF condition is not satisfied, return on the beggining and don't do anything

I have a pretty big code so I wont put it here... I made some calculation which works and now I want to repair certain things.



I created for loop with statement: if (my condition) is true break and save, else if (condition is not true) show message box and report what is wrong (like example input is 0 and should not be 0). But after that my calculation goes on till the end and dont stop there. How to stop it there until my condition is not satisfied?


What to add with return?? I have it in private void function on button click.. This bothers me becouse in my program there is lots of if conditions with show/hide options. So when program continue with calculation it show lots of 0 and bad numbers..



Thanks for help


Aucun commentaire:

Enregistrer un commentaire