I have a several JavaScript menus that are two levels deep. They work fine when calling an external program, but I get a recursion error when calling a JavaScript program such as a JavaScript external message editor or yet another JavaScript menu.
Is there a way to circumvent this error other than the obvious choice of limiting the depth of the menus to one level?
I have a several JavaScript menus that are two levels deep. They work fine when calling an external program, but I get a recursion error when calling a JavaScript program such as a JavaScript external message
editor or yet another JavaScript menu.
Is there a way to circumvent this error other than the obvious choice of limiting the depth of the menus to one level?
Re: recursion errors
By: Rastus to DOVE-Net.Synchronet_JavaScript on Sat Dec 28 2013 20:25:16
I have a several JavaScript menus that are two levels deep. Theywork Ra> fine when calling an external program, but I get a recursion
error when Ra> calling a JavaScript program such as a JavaScript external
message editor Ra> or yet another JavaScript menu.
Is there a way to circumvent this error other than the obvious choiceof Ra> limiting the depth of the menus to one level?
Can you put the code somewhere so we can look at it? Is there an exact
error message that you can provide, or is it just "Recursion error"?
I ran into trouble when I added a Message Base to a menu..
I am using Eric Oulashin's BRE/Lord Menu's. I used the example provided...
!JavaScript /sbbs/exec/L169_Menu.js line 206: too much recursion
!JavaScript /sbbs/exec/SlyEdit.js line 1: unknown (can't convert to string)
The editor is not in question, calling any JavaScript file from 2 layers deep creates the same type of error message. However there is no
problem calling JS files from The first layer of a such a JS menu.
!JavaScript /sbbs/exec/L169_Menu.js line 206: too much recursion
Re: Re: recursion errors
By: Rastus to echicken on Sun Dec 29 2013 12:03:42
I ran into trouble when I added a Message Base to a menu..
When you say you added a message base to a menu, what does that mean
exactly? A command to read messages?
L169_Menu.js is not one of the files in my BRE/LORD menu package. Can you give
more details on where you got that file from? Or is it one that you
created? If so, posting the code on & around line 206 might help us see
what the issue might be.
!JavaScript /sbbs/exec/SlyEdit.js line 1: unknown (can't convert to string)
I'm not sure about that one.. Line 1 of SlyEdit.js is a comment, so the JavaScript interpreteer should simply ignore it. I'm not sure why it's giving you an error there.
When you say "layer", do you mean creating another menu based on the
option chosen from the first menu?
!JavaScript /sbbs/exec/SlyEdit.js line 1: unknown (can't convert
to string)
I'm not sure about that one.. Line 1 of SlyEdit.js is a comment, so
the JavaScript interpreteer should simply ignore it. I'm not sure why
it's giving you an error there.
No it's not a comment, it is the error message as output by Synchronet to
This works:
(Level 0) Baja Main Menu -->
(Level 1)DOOR_Menu.js --> (Level 2) L169_Menu.js --> (Level 3)
EXT_Prog_ID (the above works but ONLY if Level3 is NOT a JavaScript Program)
This does not:
(Level 0) Baja Main Menu -->
(Level 1)DOOR_Menu.js --> (Level 2) L169_Menu.js --> (Level 3)
AnyOther.js
!JavaScript /sbbs/exec/L169_Menu.js line 206: too much recursion
You shouldn't be getting a recursion error if your JavaScript code is only two levels deep. I've only ever seen that error in JavaScript when I was calling a recursive function that had (probably) called itself hundreds or perhaps thousands of times.
You shouldn't be getting a recursion error if your JavaScript code is
only
two levels deep. I've only ever seen that error in JavaScript when I was
calling a recursive function that had (probably) called itself hundreds
or perhaps thousands of times.
With this in mind..(any without any holiday cheer in my glass).. I
revisited The Synchronet JavaScript Object Model Reference and found that I've been calling the menu scripts incorrectly:
Had been calling the Javascript menus using a command such as this:
bbs.exec("?Space_Menu.js");
But if I found if I call them using 'Load' I'm not seeing errors and the programs work properly. ie:
load("Space_Menu.js");
I can then use bbs.exec to call any JavaScript door programs ie:
bbs.exec("?/sbbs/xtrn/dicewarz/dice.js");
Or should I using some other syntax?--
Thanks,
Nick
Had been calling the Javascript menus using a command such as this:
bbs.exec("?Space_Menu.js");
But if I found if I call them using 'Load' I'm not seeing errors and
the programs work properly. ie:
load("Space_Menu.js");
I can then use bbs.exec to call any JavaScript door programs ie:
bbs.exec("?/sbbs/xtrn/dicewarz/dice.js");
This is just an example.. I would create a xtrn program using scfg for such thing... I forgot to mention that..
Or should I using some other syntax?
bbs.exec("?Space_Menu.js");
load("Space_Menu.js");
Re: Re: recursion errors
By: Rastus to Nightfox on Mon Dec 30 2013 15:20:04
bbs.exec("?Space_Menu.js");
This runs "Space_Menu.js" in its own scope, meaning that (likely) won't
have access to variables or functions defined in the script that called it.
load("Space_Menu.js");
This loads "Space_Menu.js" into the scope of the script that's currently running. (If it helps, you can think of it as essentially appending the contents of "Space_Menu.js" to the current script. That may give you some ideas as to how "Space_Menu.js" is able to reference or modify variables
and functions defined in the parent script.)
Which of these is best to use depends on the design of your module.
And neither of which is the correct way to launch an external program which has been configured in SCFG->External Programs->Online Programs. Just say'n. :-)
I'll try explain one more time..
Since you are using the BRE/LORD menus too..
Using the BRE/Lord Menus.. Create 3 Menus
Nest Them. IE: Call a JS Menu from a JS Menu and Do it a third time..
you'll see what I mean..
anytime, anywhere, anyway.. I try to call a JS from a JS from a JS I get a recursion error..
btw.. I am running Linux and 3.15b updated from source today.
If you don't understand what I am trying to say then forget it.. I'll just live with it and hope the problem is corrected in the next version....
You must be thinking of someone else. I'm not using "the BRE/Lord Menus".
Have you considered trying the current development version (3.16), as an experiment, to see if it resolves the issue?
I have been wanting to try 3.16. I like to update from CVS and I have not seen any instructions on how to upgrade to 3.16 using that method. I've been told there are instructions on the Sync Wiki, but I went all over the
You must be thinking of someone else. I'm not using "the BRE/Lord
Menus".
Sorry, my comments were directed at echicken.. I believed he said he was using them..
Digital Man wrote:
You must be thinking of someone else. I'm not using "the BRE/Lord Menus".
Sorry, my comments were directed at echicken.. I believed he said he was using them..
Have you considered trying the current development version (3.16), as an experiment, to see if it resolves the issue?
I have been wanting to try 3.16. I like to update from CVS and I have not seen any instructions on how to upgrade to 3.16 using that method.
you download from the cvs and drop in the files. do not replace any custom scripts or mods you have.
backup first.
this is a good opportunity to learn about what does what and where it is located in regards to synchronet.
btw, i dont believe i was ever a user on your bbs, but you have my ip blocked. blocking my ip didnt really accomplish keeping me off your
system, just was wondering why i was blocked cause i find that odd.
btw, i dont believe i was ever a user on your bbs, but you have my ip blocked. blocking my ip didnt really accomplish keeping me off your
system, just was wondering why i was blocked cause i find that odd.
btw, i dont believe i was ever a user on your bbs, but you have my ip blocked. blocking my ip didnt really accomplish keeping me off your system, just was wondering why i was blocked cause i find that odd.
blocked. blocking my ip didnt really accomplish keeping me off your system, just was wondering why i was blocked cause i find that odd.
Thanks but I had asked about upgrading to 3.16. I keep current.. here's
the script I run at least weekly:
You were on my board but I removed your account and blocked your IP because you requested it after receiving a message I had sent to all users about hanging up properly. It was early on.. and at the time there were only a few users on my board. But neither you or anyone else is gonna tell me how to run my BBS. In short.. you were being an ass..
just because someone is giving you criticism, that doesnt mean they
"are telling you how to run your bbs".
it must have been a real snotty email for me to reply to you like that
and tell you to block my ip and how to do it. i dont just do that on a whim. nothing pisses me off more than a sysgod.
it must have been a real snotty email for me to reply to you like that
and tell you to block my ip and how to do it. i dont just do that on a
whim. nothing pisses me off more than a sysgod.
Sysop: | Chris Crash |
---|---|
Location: | Huntington Beach, CA. |
Users: | 578 |
Nodes: | 8 (0 / 8) |
Uptime: | 29:19:44 |
Calls: | 10,736 |
Calls today: | 1 |
Files: | 5 |
Messages: | 443,196 |
Posted today: | 1 |