Skip to content

namespace push

Sub-commandNamespace
namespace push

Also searchable as: namespace push

namespace push remembers the current namespace (its name and whether it is local or global) on a stack. namespace pop goes back to it. Pushes can be nested: each pop returns to the namespace of the matching push.

Use the pair around code that switches namespaces, so it leaves the caller where it was.

gosub work
display ok Back in #NSName
halt
sub work
namespace push
namespace local work
set !x 1 ; uses its own !variables
namespace pop
return

See also

Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.