• Variables declared in req

    From Nightfox@VERT/DIGDIST to Digital Man on Wed Sep 25 09:37:00 2019
    Hi DM,

    For SlyEdit, there are some global variables I define in one of the required()'d scripts (i.e., in SlyEdit_Misc.js) that are used in SlyEdit.js, and it has always worked fine.

    Today I updated my Synchronet binaries to the latest (September 25th) built binaries (for Windows), and also updated my JavaScript scripts from CVS. Then I noticed that when I try to run SlyEdit, it shows one of the variables is not defined - it's one of the variables defined in SlyEdit_Misc.js. For SlyEdit.js line 150, I get an error saying gUserSettingsFilename is not defined. gUserSettingsFilename is declared in SlyEdit_Misc.js as follows:

    var gUserSettingsFilename = backslash(system.data_dir + "user") + format("%04d", user.number) + ".SlyEdit_Settings";

    I thought it might be my Synchronet binaries, so I reverted back to my previous binaries (from September 7th), but I'm having the same problem.

    If I copy the declaration of gUserSettingsFilename into SlyEdit.js, I then see a similar error that something else (a function declared in SlyEdit_Misc.js) isn't defined in SlyEdit.js

    SlyEdit was working fine before I updated my binaries & .js files. I temporarily switched to another editor so I could type this message. Do you know what might have changed that may have caused this?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Wed Sep 25 10:25:00 2019
    Re: Variables declared in required libraries
    By: Nightfox to Digital Man on Wed Sep 25 2019 01:37 pm

    Hi DM,

    For SlyEdit, there are some global variables I define in one of the required()'d scripts (i.e., in SlyEdit_Misc.js) that are used in SlyEdit.js, and it has always worked fine.

    Today I updated my Synchronet binaries to the latest (September 25th) built binaries (for Windows), and also updated my JavaScript scripts from CVS. Then I noticed that when I try to run SlyEdit, it shows one of the variables is not defined - it's one of the variables defined in SlyEdit_Misc.js. For SlyEdit.js line 150, I get an error saying gUserSettingsFilename is not defined. gUserSettingsFilename is declared in SlyEdit_Misc.js as follows:

    var gUserSettingsFilename = backslash(system.data_dir + "user") + format("%04d", user.number) + ".SlyEdit_Settings";

    I thought it might be my Synchronet binaries, so I reverted back to my previous binaries (from September 7th), but I'm having the same problem.

    If I copy the declaration of gUserSettingsFilename into SlyEdit.js, I then see a similar error that something else (a function declared in SlyEdit_Misc.js) isn't defined in SlyEdit.js

    SlyEdit was working fine before I updated my binaries & .js files. I temporarily switched to another editor so I could type this message. Do you know what might have changed that may have caused this?

    I moved some KEY_* defines from sbbsdefs.js to a new file: load/key_defs.js and in there added some CTRL_* key definitions that are commonly used (CTRL_A - CTRL_Z).

    I'm guessing that one of your require() statements is checking for a symbol that's now defined by sbbsdefs.js->key_defs.js, so your load-lib isn't being loaded. Changing the symbol being checked for in the require() call should fix that.

    digital man

    This Is Spinal Tap quote #18:
    Sustain, listen to it. Don't hear anything. You would though were it playing. Norco, CA WX: 85.6øF, 46.0% humidity, 9 mph ENE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Wed Sep 25 10:54:00 2019
    Re: Variables declared in required libraries
    By: Digital Man to Nightfox on Wed Sep 25 2019 02:25 pm

    I moved some KEY_* defines from sbbsdefs.js to a new file: load/key_defs.js and in there added some CTRL_* key definitions that are commonly used (CTRL_A - CTRL_Z).

    I'm guessing that one of your require() statements is checking for a symbol that's now defined by sbbsdefs.js->key_defs.js, so your load-lib isn't being loaded. Changing the symbol being checked for in the require() call should fix that.

    Aside from the SlyEdit scripts, the only libraries it calls require() to load are sbbsdefs.js and dd_lightbar_menu.js (which I wrote). With sbbsdefs.js, it uses K_NOCRLF for the symbol being checked, and it looks like K_NOCRLF is still in sbbsdefs.js. So I'm not sure what else I could look for.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Wed Sep 25 11:35:00 2019
    Re: Variables declared in required libraries
    By: Nightfox to Digital Man on Wed Sep 25 2019 02:54 pm

    Re: Variables declared in required libraries
    By: Digital Man to Nightfox on Wed Sep 25 2019 02:25 pm

    I moved some KEY_* defines from sbbsdefs.js to a new file: load/key_defs.js and in there added some CTRL_* key definitions that are commonly used (CTRL_A - CTRL_Z).

    I'm guessing that one of your require() statements is checking for a symbol that's now defined by sbbsdefs.js->key_defs.js, so your load-lib isn't being loaded. Changing the symbol being checked for in the require() call should fix that.

    Aside from the SlyEdit scripts, the only libraries it calls require() to load are sbbsdefs.js and dd_lightbar_menu.js (which I wrote). With sbbsdefs.js, it uses K_NOCRLF for the symbol being checked, and it looks like K_NOCRLF is still in sbbsdefs.js. So I'm not sure what else I could look for.

    Looking at SlyEdit.js, I see this line:

    require(gStartupPath + "SlyEdit_Misc.js", "CTRL_A");

    That means that SlyEdit_Misc.js won't be load()'d unless CTRL_A is undefined. Well CTRL_A is now defined by key_defs.js which is loaded by sbbsdefs.js. So change that "CTRL_A" to something more unique to SlyEdit_Misc.js.

    digital man

    Synchronet "Real Fact" #10:
    The name "DOVE-Net" was suggested by King Drafus (sysop of The Beast's Domain). Norco, CA WX: 84.6øF, 51.0% humidity, 8 mph E wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Wed Sep 25 13:08:00 2019
    Re: Variables declared in required libraries
    By: Digital Man to Nightfox on Wed Sep 25 2019 03:35 pm

    Looking at SlyEdit.js, I see this line:

    require(gStartupPath + "SlyEdit_Misc.js", "CTRL_A");

    That means that SlyEdit_Misc.js won't be load()'d unless CTRL_A is undefined. Well CTRL_A is now defined by key_defs.js which is loaded by sbbsdefs.js. So change that "CTRL_A" to something more unique to SlyEdit_Misc.js.

    Ah, that makes sense. I made that update and that worked. Thanks.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com