Subj : Using sbbsdefs and userdefs
To   : Nightfox
From : Digital Man
Date : Wed Aug 16 2023 02:35 pm

 Re: Using sbbsdefs and userdefs
 By: Nightfox to Digital Man on Wed Aug 16 2023 02:11 pm

>   Re: Using sbbsdefs and userdefs
>   By: Digital Man to Nelgin on Wed Aug 16 2023 12:59 pm
>
>  DM> The second argument to require() is just one variable name that you
>  DM> expect to be defined in the required script, not all of the variable
>  DM> names that you expect to be defined. The entire script that you
>  DM> require() is evaluated if the specified named variable is not defined.
>
> So for require(), if you want to be able to use everything from the required
> file, would you omit the 2nd argument (or pass an empty string)?

No, you would pass *one* of your *required* symbols (functions or variables) from the child script. Anything else defined in that file just comes along for free.

> In my .js
> scripts, I have passed a variable name as the 2nd argument for require(),
> and I have been able to use other variables from that .js as well.

Right, and that's how it's supposed to work.
--
                                           digital man (rob)

Breaking Bad quote #13:
I got twenty bucks that says he's a beaner. - Hank Schrader
Norco, CA WX: 96.6�F, 31.0% humidity, 10 mph SSE wind, 0.00 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net