Subj : Using sbbsdefs and userdefs To : Nelgin From : Digital Man Date : Wed Aug 16 2023 12:59 pm Re: Using sbbsdefs and userdefs By: Nelgin to digital man on Wed Aug 16 2023 02:12 pm > Hi am I supposed to use sbbsdefs.js and userdefs.js in the same script? No, since sbbsdefs.js already requires userdefs.js, you don't need to use (load or require) both. > I'm using several properties from userdefs so I have > > require("sbbsdefs.js", 'USER_EXPERT'); > load("userdefs.js"); > > but my script complains about > > TypeError: redeclaration of const USER_DELETED Using require() instead of load() would fix that. > Since sbbsdefs is only importing USER_EXPERT, shouldn't it ignore the > definition of USER_DELETED ? And why would it be defined in there when it's > already defined in userdefs.js? > > Nightfox suggested if I use require with userdefs then it might look at the > other properties anyway, but that's not the case. > > Would appreciate some advice please. The second argument to require() is just one variable name that you expect to be defined in the required script, not all of the variable names that you expect to be defined. The entire script that you require() is evaluated if the specified named variable is not defined. -- digital man (rob) This Is Spinal Tap quote #11: Nigel Tufnel: No. no. That's it, you've seen enough of that one. Norco, CA WX: 95.9øF, 35.0% humidity, 4 mph E wind, 0.00 inches rain/24hrs .