Search code examples
haxe

Is there some kind of exit statement in Haxe?


Is there some kind of exit statement in haxe? Like

import sys
sys.exit(0)

in Python or

System.exit(0);

in Java?

P.S.: Only need this for sys targets ...


Solution

  • You can use Sys.exit(code) in sys targets (cpp, cs, hl, java, lua, macro, neko, php, python).

    https://api.haxe.org/Sys.html#exit

    And for Flash target: flash.system.System.exit(code) https://api.haxe.org/flash/system/System.html#exit