Subj : Help using gettext.js
To : Digital Man
From : vela025
Date : Fri Oct 18 2024 01:14 am
> Yup, I think so. Did you try it?
> --
> digital man (rob)
No I was a little worried it would corrupt a settings file somewhere. But I've
backed up everything now and this:
if(confirm("Are you using a BBC Micro Mode 7 terminal"))
user.lang = "bbcmicro";
user.settings &= ~USER_AUTOTERM | USER_ANSI | USER_RIP | USER_WIP |
USER_HTML | USER_PETSCII | USER_UTF8;
user.settings &= ~USER_EXASCII;
else
user.lang = "";
Gives line 16:SyntaxError (which is the else line). Else is not indented and at
the margin inline with IF. Indenting also give the same error. In the console
it displays:
logon.js line 16: SyntaxError: syntax error
10/18 08:44:04 term Node 1 <Vela025> !ERROR 2 (No such file or directory) in
exec.cpp line 644 (js_execfile) compiling "/home/ed/sbbs/exec/logon.js"
access=0
Desperate times = desperate measures so I used ChatGTP to help which
recommended the following structure:
if (confirm("Are you using a BBC Micro Mode 7 terminal")) {
user.lang = "bbcmicro";
user.settings &= ~(USER_AUTOTERM | USER_ANSI | USER_RIP | USER_WIP |
USER_HTML | USER_PETSCII | USER_UTF8);
user.settings &= ~USER_EXASCII;
} else {
user.lang = "";
}
This does get to displaying the question and no error message but then hangs,
with the console displaying:
logon.js line 15: ReferenceError: USER_EXASCII is not defined, after double
checking I realised it should be USER_NO_EXASCII:
if (confirm("Are you using a BBC Micro Mode 7 terminal")) {
user.lang = "bbcmicro";
user.settings &= ~(USER_AUTOTERM | USER_ANSI | USER_RIP | USER_WIP |
USER_HTML | USER_PETSCII | USER_UTF8);
user.settings &= ~USER_EXASCII;
} else {
user.lang = "";
}
Which worked!! So now I'm going to look at CASE (I think?) so that the user
will initially get:
Please select terminal type:
(4) 0 Column ASCII
Acorn Mode (7)
(8) 0 Column ANSI
Enter 4, 7 or 8: