// `exit` ends the program at once with the given status (here 3).
import std.io.println;
import std.process.exit;
def main(): int {
println("exiting with status 3");
exit(3);
println("never printed");
return 0;
}// `اخرج` ينهي البرنامج فورا بالحالة المعطاة (هنا 3).
استورد std.io.println;
استورد std.process.exit;
عرف الرئيسية(): عدد {
اطبع_سطر("الخروج بالحالة 3");
اخرج(3);
اطبع_سطر("لا يُطبع أبدا");
أرجع 0;
}
Run it
With the interpreter, without compiling:
./build/sultanc run examples/en/process/exit_code.snOr compile it to an executable:
./build/sultanc examples/en/process/exit_code.sn -o build/example && ./build/example