Re: Scope Problem
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Apr 23, 2005
- 415 views
On Fri, 22 Apr 2005 12:24:51 -0700, codepilot Gmail Account <codepilot at gmail.com> wrote: > >You define a global type/procedure/function/constant/variable in the >main file, then include file(s) that define the same global. Then you >include a file that uses it, what namespace can you put for the main >file? Bizzare but true:
include main.e as anynameyoulike
in the include file(s). Even though they are themselves included by main.e, it will not cause a problem. You can even do this:
-- this is main.exw. global integer k k=99 include main.exw as main ?main:k
Euphoria spots that a file has already been loaded, and instead of reloading it just adds a namespace tag. Regards, Pete