Without copy-pasting my code here, how can I stop my ADA program from executing anymore lines of code during run-time if it calculates a certain value to 'X'?
something like:
variable_name := variable_name +4;
if variable_name >1 then
// END program here and dont execute any lines under this one
end if
I am not new to programming but new to ADA so finding the correct syntax is a pain. Any help?
abort
statement has nothing to do with this. – Pyxidiumwhile
loop that stops when you're done, or by using theexit
statement to exit a loop). It can also be done byreturn
from a procedure that has the main loop in it. If it's normal for your calculation to reach X, then you want to do one of these--please do not try to find a way to do an "emergency exit" from your program, which would be terrible practice. If you really do need an emergency exit, please provide more details so that I can give an appropriate answer. – Pyxidium