Subj : More dumb questions
To   : Mortifis
From : echicken
Date : Fri Jul 19 2019 11:16 am

 Re: More dumb questions
 By: Mortifis to All on Fri Jul 19 2019 11:18:34

Mo> When scripting a commandline utility, console.clear() and other console.*
Mo> functions are 'undefined' Is there a load(*.js) I need to call at the
Mo> start of the script to has access to those functions or are they hard
Mo> coded in sbbs?

'console' only exists in scripts running in the 'bbs' context, ie. under a telnet/rlogin/ssh session.
Its methods are strictly for interacting with a remote terminal and they aren't relevant under jsexec,
the webserver, or other places where Synchronet runs JS.

There are ways to deal with running scripts either under jsexec or in a BBS session (you seemed to have
the idea of doing 'if (js.global.console)').  Sometimes it's just easier to pick one or the other.  This
script in particular (generating a report about dupe users) seems like a utility I'd just want to run
under jsexec and I wouldn't need to run during an ssh session.

---
echicken
electronic chicken bbs - bbs.electronicchicken.com
� Synchronet � electronic chicken bbs - bbs.electronicchicken.com