Door Games Unlimited

Welcome, Guest.


Subject: Re: recursion errors Date: Fri Jan 03 2014 11:28:32
From: echicken To: Rastus

  Re: Re: recursion errors
  By: Rastus to Nightfox on Mon Dec 30 2013 15:20:04

 Ra> 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.

 Ra> 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.

---
echicken
electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
 ■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com

Previous Message       Next Message
In Reply To: Re: recursion errors (Rastus)
Replies: Re: recursion errors (Digital Man)