Re: scope problem

new topic     » goto parent     » topic index » view thread      » older message » newer message
canadiancoder said...

What you posted is almost it, but the difference is symbol 'A' was trying to be accessed from within a procedure. I will post a simple example, since my actual code is too large.

characters.e 
 
sequence Character 
Character = { "Lothar the Brave ", 34, 56, 43, "Long Sword", ... etc. } 
 
global constant  
Name = 1, ...etc... Weapon = 5 

items.e 
 
include characters.e 
 
procedure ArmCharacter( sequence chr ) 
    .. some code... 
    printf(1, "Your current weapon is: %s", { c[Weapon] } ) 
end procedure 

Gives me a "Weapon" not declared error.

What svn revision is your binary? And which file is included first?

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu