Advertisement

Accessing global property from within script namespace

Started by May 02, 2012 08:46 PM
2 comments, last by _Vicious_ 12 years, 10 months ago
Hi Andreas,

I'm having trouble getting my script to work. Whenever I try to access application-registered global property from within namespace'd method, the script fails to compile with error "'property' is not declared".
Please note that the property in question was registered without prior setDefaultNamespace call, basically it resides in global namespace. Prefixing property references with '::' doesn't work (the error message changes to "'::property' is not declared").
Looks like a bug that slipped in when implementing the support for namespaces.

I'll investigate it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
I've fixed this bug in revision 1295.

Observe that the compiler does not yet do a recursive search in parent namespaces, so you need to explicitly name the global scope with :: in order to access the global property from the function in the namespace.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks, Andreas! Confirming the bug as fixed.

This topic is closed to new replies.

Advertisement