Skip to content
Snippets Groups Projects
Commit 994dc592 authored by deuce's avatar deuce
Browse files

Disable auto_terminate.

Remove console.getkey() and console.getkeys()
parent b178f7da
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,12 @@ function CheckTime()
}
}
function CheckTerminate()
{
if(js.terminated)
exit(0);
}
function InputFunc(values)
{
var str='';
......@@ -51,6 +57,7 @@ InputFuncMainLoop:
for(;;) {
CheckNode();
CheckTime();
CheckTerminate();
key=console.inkey(100);
if(key == '') {
......
......@@ -99,7 +99,7 @@ function EnterSector() /* 20000 */
break;
case 'Q':
console.write("Are you sure (Y/N)? ");
if(console.getkeys("YN")=='Y') {
if(InputFunc(['Y','N'])=='Y') {
exit_tw2=true;
return(false);
}
......
......@@ -49,6 +49,7 @@ twopeng.open("a", true);
var today=system.datestr(system.datestr());
js.on_exit("do_exit()");
js.auto_terminate=false;
/* Run maintenance */
if(Settings.MaintLastRan != system.datestr()) {
RunMaint();
......@@ -180,7 +181,7 @@ function Menu()
console.writeln("<Quit>");
console.attributes="W";
console.write("Are you sure (Y/N)? ");
if(console.getkeys("YN")=='Y') {
if(InputFunc(['Y','N'])=='Y') {
exit_tw2=true;
return;
}
......@@ -224,11 +225,9 @@ function do_exit()
function Instructions()
{
console.write("Do you want instructions (Y/N) [N]? ");
switch(console.getkey().toUpperCase()) {
case 'Y':
console.crlf();
console.printfile(fname("twinstr.doc"));
break;
if(InputFunc(['Y','N'])=='Y') {
console.crlf();
console.printfile(fname("twinstr.doc"));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment