4

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 ...

quant
  • 2,184
  • 2
  • 19
  • 29
  • 1
    [Does this help](https://stackoverflow.com/questions/17491958/how-to-exit-haxe-openfl-program)? (disclaimer: I don't know that language) – user202729 Mar 11 '18 at 08:18
  • @user202729 Yes and no, Haxe code can get cross-compiled into multiple languages, like neko, javascript, python, ... . The answer you provided does only work, if the code gets cross-compiled into the flash language ... – quant Mar 11 '18 at 10:13

1 Answers1

7

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

ali_o_kan
  • 452
  • 5
  • 18
kLabz
  • 1,837
  • 1
  • 14
  • 14