enable_quit

enable_quit($enable_exit); - allow or prohibit script execution by the command $app->quit().

The function accepts parameters as input:

  • $enable_exit – flag prohibiting the execution of the $app->quit command. if true - exit is allowed, and if false - it is locked.

    After testing, the function returns the result of its work to the script :
  • true – successfully worked
  • false – operation failed

    PHP example: app->".basename(__FILE__)."
    "; //1 echo "1.Prohibit exiting by app->quit:"; echo $app->enable_quit(false)."
    "; //2 echo "2.Let's try to exit:"; if(!$app->quit()) echo "no exit
    "; //3 echo "3.Allow exit by app->quit:"; echo $app->enable_quit(true); //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7011" from xweb_human_emulator import * # Start echo("
    app.xxxxxxxxx
    ") # 1 echo("1.Disable exiting by app.quit:") echo(app.enable_quit(false), "
    ") # 2 echo("2.Let's try to exit:") if not app.quit(): echo("exit denied
    ") # 3 echo("3.Allow exiting with app.quit:") echo(app.enable_quit(true)) # end echo("

    ") # Quit app.quit()
    C# example: #region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program: XHEScript { static void Main(string [] args) { //init XHE server = "127.0.0.1:7010"; InitXHE(); //Start echo("
    app.enable_quit
    "); //1 step echo("1.Disable exiting by app.quit:" + app.enable_quit(false) + " n"); //step 2 echo("2.Let's try to exit:"); if(!app.quit()) echo("no exit n"); //step 3 echo("3.Disable exiting by app.quit:" + app.enable_quit(true) + " n"); //end echo("

    "); app.quit(); } }
    Java Script example: //connect the object to control the emulator, if not already connected xhe_host = "127.0.0.1:7010"; echo = require("../../../Templates JS/xweb_human_emulator.js"); //Start echo("
    app.enable_quit
    "); //1 step echo("1.Disable exiting by app.quit:"); echo(app.enable_quit(false) + "
    "); //step 2 echo("2.Let's try to exit:"); if(!app.quit()) echo("no exit
    "); //step 3 echo("3.Allow app.quit to exit:"); echo(app.enable_quit(true)); //end echo("

    "); //Quit app.quit();