Re: Scope Problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

codepilot Gmail Account 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? globa:globular is globa.e, globb:globular is globb.e but nothing
> for the main file?
> Dan
> 
> }}}
<eucode>
> <test.exw>
> global type globular(atom a)
> =09return a=0
> end type
> 
> include globa.e as globa
> include globb.e as globb
> 
> include test2.e
> </test.exw>
> <globa.e>
> global type globular(atom a)
> =09return a=1
> end type
> </globa.e>
> <globb.e>
> global type globular(atom a)
> =09return a=10
> end type
> </globb.e>
> <test.e>
> globular test
> </test.e>
> </eucode>
{{{

> .\test2.e:1
> A namespace qualifier is needed to resolve globular.
> globular is defined as a global symbol in:
>     test.exw
>     .\globa.e
>     .\globb.e
> 
> globular test
>        ^
> 
> 


You've got too many globals.




global.e

global integer a


mainProgram.exw include globals.e

global integer a

results in 'a namespace qualifier is need to define a'

you can define a global only once in main program and/or includes.

Don Cole SF }}}

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu