Skip to content
Snippets Groups Projects
Commit a775092c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use P_NOABORT mode flag for calls to console.putmsg()

The Baja PRINT function (used in yesnobar.src/noyesbar.src) calls putmsg()
with P_SAVEATR|P_NOABORT. Without P_NOABORT, putmsg() doesn't display anything
if the global console abort (SS_ABORT) flag is set.

So hitting 'N' or Ctrl-C at one yes/no or no/yes prompt would mean any
immediately subsequent yes/no or no/yes prompt would not be displayed.

Now that we have to require('sbbsdefs.js') for the P_NOABORT definition,
this'll run a little slower. :-(

Enable/conform to "use strict" mode.
parent 40c87dc4
No related branches found
No related tags found
No related merge requests found
// JS version of noyesbar.src
require("sbbsdefs.js", "P_NOABORT");
"use strict";
const yes_str = bbs.text(bbs.text.Yes);
const yes_key = yes_str[0];
......@@ -15,7 +18,7 @@ if(console.question.substring(0, 2) == "\x01\?") {
console.question = console.question.substring(2);
}
console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@");
console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT);
var affirm = false;
while(bbs.online && !js.terminated) {
var str;
......@@ -26,7 +29,7 @@ while(bbs.online && !js.terminated) {
console.print(str);
var key = console.getkey(0).toUpperCase();
console.backspace(console.strlen(str));
console.print("\1n\1h\1>");
console.print("\x01n\x01h\x01>");
if(console.aborted) {
affirm = false;
break;
......
// JS version of yesnobar.src
require("sbbsdefs.js", "P_NOABORT");
"use strict";
const yes_str = bbs.text(bbs.text.Yes);
const yes_key = yes_str[0];
const no_str = bbs.text(bbs.text.No);
......@@ -15,7 +19,7 @@ if(console.question.substring(0, 2) == "\x01\?") {
console.question = console.question.substring(2);
}
console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@");
console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT);
var affirm = true;
while(bbs.online && !js.terminated) {
var str;
......@@ -26,7 +30,7 @@ while(bbs.online && !js.terminated) {
console.print(str);
var key = console.getkey(0).toUpperCase();
console.backspace(console.strlen(str));
console.print("\1n\1h\1>");
console.print("\x01n\x01h\x01>");
if(console.aborted) {
affirm = false;
break;
......
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