TIP: Click on subject to list as thread! ANSI
echo: synchronet
to: Digital Man
from: vela025
date: 2024-10-18 01:14:00
subject: Help using gettext.js

> 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  !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:
--- SBBSecho 3.20-Linux
                                               
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.