Hi All,
Just a couple of questions about the JS implementation in SBBS..
Firstly, a question about timed events:
Reading script from /home/bbs/mods/stock/main.js /home/bbs/mods/stock/main.js compiled in 0.00 seconds
Hello World
!JavaScript /home/bbs/mods/stock/main.js line 13: ReferenceError: setTimeout is not defined
/home/bbs/mods/stock/main.js executed in 0.02 seconds
setTimeout is not defined? How does one go about executing
timed events?
Secondly, is there a standard way for SBBS apps (doors, utils and
other things) to store arbitrary data in a database style format?
I cannot find anything in the API documentation that looks like
it's supported.
If there isn't... what are other people using for their persistent
data stores for extensions to and doors for SBBS?
!JavaScript /home/bbs/mods/stock/main.js line 13: ReferenceError: setTimeout is not defined
setTimeout is not defined? How does one go about executing
timed events?
setTimeout is not defined? How does one go about executing
timed events?
Secondly, is there a standard way for SBBS apps (doors, utils and
other things) to store arbitrary data in a database style format?
I cannot find anything in the API documentation that looks like
it's supported.
While we don't have the setTimeout function that's present in many browsers, we
do have exec/load/event-timer.js, which mcmlxxix wrote to provide a Timer object. More info is available in the comments at the top of event-timer.js, but here's a rough example of how to use it:
ini files (using the Synchronet File class) is one method (see binarydecoder.js
for an example), json files is another method (see exec/load/json-db.js and friends for a helpful library). One sysop had a patch which added support for
sqlite to Synchronet, but I'm not aware of any apps (doors, utils, etc.) which
use it (yet).
On 19/07/12 19:33, Digital Man wrote:
ini files (using the Synchronet File class) is one method (see binarydecoder.js for an example), json files is another method (see exec/load/json-db.js and friends for a helpful library). One sysop had a patch which added support for sqlite to Synchronet, but I'm not aware of any apps (doors, utils, etc.) which use it (yet).
The SQL patch is probably the most appropriate tool for what I'd like to do.. any pointers or where I may be able to find it?
Secondly, is there a standard way for SBBS apps (doors, utils and
other things) to store arbitrary data in a database style format?
I cannot find anything in the API documentation that looks like
it's supported.
There's the JSON DB (json-db.js) and RecordFile (recordfile.js)... though I'm
not sure what you mean be "database style format". There's also the ini bits
of the File class.
Subject: Re: setTimeout and data storage
@VIA: OGLAROON
@MSGID: <500882F8.1220.sync_js@oglaroon.servebeer.com>
@REPLY: <50084AC8.1219.sync_js@nix.synchro.net>
@TZ: 0258
On 20/07/12 03:58, Deuce wrote:
Secondly, is there a standard way for SBBS apps (doors, utils and
other things) to store arbitrary data in a database style format?
I cannot find anything in the API documentation that looks like
it's supported.
There's the JSON DB (json-db.js) and RecordFile (recordfile.js)... though not sure what you mean be "database style format". There's also the ini b of the File class.
by "database style format", I meant just anything that isn't flat text
and is somewhat index-able. Doesn't need to be much more than a
persistent hash so JSON DB sounds like it would be the best option.
Jared
--
Jared Quinn ----------------------+-------------------------------------------O---O- jared@jaredquinn.info | Knowledge is knowing a tomato is a fruit; i 3:712/101@fidonet | Wisdom is not putting it in a fruit salad.\___/ ----------------------+-------------------------------------------------
setTimeout is not defined? How does one go about executing
timed events?
Secondly, is there a standard way for SBBS apps (doors, utils and
other things) to store arbitrary data in a database style format?
I cannot find anything in the API documentation that looks like
it's supported.
If there isn't... what are other people using for their persistent
data stores for extensions to and doors for SBBS?
One sysop had a patch which added support for sqlite to Synchronet,
but I'm not aware of any apps (doors, utils, etc.) which use it (yet).
One sysop had a patch which added support for sqlite to Synchronet,
but I'm not aware of any apps (doors, utils, etc.) which use it (yet).
Is there an example out there for creating a db, create table, insert/update/delete records etc?
The patch used to be hosted here: http://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/
but the file appears to be missing now... get ahold of Ragnarok (Synchronet sysop) and see if it's still available somewhere.
digital man
One sysop had a patch which added support for sqlite to Synchronet,
but I'm not aware of any apps (doors, utils, etc.) which use it (yet).
Is there an example out there for creating a db, create table, insert/update/delete records etc?
you can see the example file:
http://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/js_sqlite_test.js
and little example app:
http://bbs.docksud.com.ar/~ragnarok/sync/rssviewer/
One sysop had a patch which added support for sqlite to Synchronet,
but I'm not aware of any apps (doors, utils, etc.) which use it (yet).
Is there an example out there for creating a db, create table,
insert/update/delete records etc?
you can see the example file:
http://bbs.docksud.com.ar/~ragnarok/sync/js_sqlite/js_sqlite_test.js
and little example app:
http://bbs.docksud.com.ar/~ragnarok/sync/rssviewer/
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 139:44:37 |
Calls: | 369 |
Files: | 2 |
Messages: | 38,437 |