[PB 6.11 LTS] [Not a Bug] Can not access address of variable in module

Just starting out? Need help? Post your questions and find answers here.
User avatar
macros
User
User
Posts: 88
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

[PB 6.11 LTS] [Not a Bug] Can not access address of variable in module

Post by macros »

When using a module prefix with the two double colons together with an @ the compiler throws an error.
The syntax seems to be valid to me.

Edit: solved below by fryquez, maybe document behaviour?

Code: Select all

DeclareModule M_module
  Global g_var=20
EndDeclareModule

Module M_module
EndModule

Debug M_module::g_var
; Following line causes an error
Debug @M_module::g_var
Within a more complex code and within a "with" statement I get a Macro Error and a space seems to be inserted between the two double colons.
Last edited by macros on Fri Jun 07, 2024 9:53 pm, edited 1 time in total.
fryquez
Enthusiast
Enthusiast
Posts: 391
Joined: Mon Dec 21, 2015 8:12 pm

Re: [PB 6.11 LTS] Can not access address of variable in module

Post by fryquez »

Put the @ after module name.

Code: Select all

Debug M_module::@g_var
User avatar
macros
User
User
Posts: 88
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

Re: [PB 6.11 LTS] Can not access address of variable in module

Post by macros »

Thanks that solves it!
Of course it also works within the with statement.

I think this should be added to the documentation, it would be good if the behaviour with the module syntax is mentioned in the "Pointers and memory access" or "Module" help.
Post Reply