^C works now

This commit is contained in:
minjaesong
2020-06-16 08:15:57 +09:00
parent 810e9e0c0b
commit 4e9dcf71e0
2 changed files with 6 additions and 10 deletions

View File

@@ -33,11 +33,11 @@ con.getyx = function() {
};
con.hitterminate = function() { // ^C
sys.poke(-40, 1);
return (sys.peek(-41) == 31 && (sys.peek(-41) == 129 || sys.peek(-41) == 130));
return (sys.peek(-41) == 31 && (sys.peek(-42) == 129 || sys.peek(-42) == 130));
};
con.hiteof = function() { // ^D
sys.poke(-40, 1);
return (sys.peek(-41) == 32 && (sys.peek(-41) == 129 || sys.peek(-41) == 130));
return (sys.peek(-41) == 32 && (sys.peek(-42) == 129 || sys.peek(-42) == 130));
};
con.color_fore = function(n) { // 0..7; -1 for transparent
if (n < 0)

View File

@@ -17,9 +17,9 @@ var cmdbufMemFootPrint = 0;
var prompt = "Ok";
var lang = {};
lang.badNumberFormat = "Bad number format";
lang.badOperatorFormat = "Bad number format";
lang.badFunctionCallFormat = "Bad function call format";
lang.badNumberFormat = "Illegal number format";
lang.badOperatorFormat = "Illegal number format";
lang.badFunctionCallFormat = "Illegal function call";
lang.unmatchedBrackets = "Unmatched brackets";
lang.syntaxfehler = function(line, reason) {
return "Syntax error" + ((line !== undefined) ? (" in "+line) : "") + (reason !== undefined) ? (": "+reason) : "";
@@ -1170,9 +1170,6 @@ basicFunctions.fre = function(args) {
basicFunctions.run = function(args) { // RUN function
var linenumber = 1;
var oldnum = 1;
var countup = 0;
do {
if (cmdbuf[linenumber] !== undefined) {
oldnum = linenumber;
@@ -1181,8 +1178,7 @@ basicFunctions.run = function(args) { // RUN function
else {
linenumber += 1;
}
countup += 1;
if (con.hitterminate() || countup >= 100) {
if (con.hitterminate()) {
println("Break in "+oldnum);
break;
}