user4589720
user4589720

Reputation:

Is there a way to terminate a program during any part of execution?

For example in c you could say have a condition and if that condition is not met you can return(0); and this would terminate the program.

Is there a way I could do this in Ada?

Upvotes: 2

Views: 668

Answers (2)

Jules
Jules

Reputation: 11

if you can use GNAT, try GNAT.OS_Lib.OS_Exit(1); this terminates the program with the given exit code.

However, if you want some finalisation try GNAT.OS_Lib.OS_Abort;

Upvotes: 0

CCebrian
CCebrian

Reputation: 75

In C you should call exit() function;

But investigating your work, i found some information about.

if some_condition then Abort_Task (Current_Task); end if;

Ada Process Termination Code

Upvotes: 0

Related Questions