From 93bed7b51d4217472ac854b88b6afa406e724e44 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 9 Jul 2024 14:44:13 -0400 Subject: whichbas: restore TRACE/EXTEND logic. --- whichbas.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/whichbas.c b/whichbas.c index 5fa48a6..fdda5bf 100644 --- a/whichbas.c +++ b/whichbas.c @@ -255,8 +255,7 @@ CALLBACK(handle_cmd) { } break; case 0x58: /* TRACE (optional + or -), EXTEND (BXE; no args) */ - /* PARTIAL: TRACE +/- detected, TRACE without arg can't be - told from EXTEND. */ + /* COMPLETE (except for unlikely direct mode EXTEND) */ if(nexttok == OP_PLUS || nexttok == OP_MINUS) { bas_type = BT_TURBO; print_result(); @@ -265,6 +264,15 @@ CALLBACK(handle_cmd) { as the regular one, but can't be entered in the editor. Assume no BXL program contains this token. */ remove_type(BT_BXL); + /* In BXE, EXTEND can't actually appear in a program (it's direct + mode only). The only way to get EXTEND into a BXE program is + to do a direct mode command like: + EXTEND:SAVE "D:PROG" + ...which of course puts it at line 32768. So if this token + appears on any other line, it must be Turbo's TRACE. */ + if(lineno < 32768) { + remove_type(BT_BXE); + } } break; case 0x59: /* TEXT or PROCEDURE */ -- cgit v1.2.3