Page 1 of 1

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

Posted: Fri Jun 07, 2024 3:38 pm
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.

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

Posted: Fri Jun 07, 2024 3:49 pm
by fryquez
Put the @ after module name.

Code: Select all

Debug M_module::@g_var

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

Posted: Fri Jun 07, 2024 9:51 pm
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.