Difference between revisions of "NameSpace pop"
From Wiki
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{command header|Namespace Commands}} | |
− | + | ||
− | + | ||
− | + | {{body|nameSpace pop|The namespace pop command restores the current namespace name and scope from an internal stack. | |
− | + | ||
− | + | The default namespace is named STD and has local scope. This namespace is restored when the script is stopped, or there are no previous namespaces defined at the point that a nameSpace pop occurs.}} | |
− | + | ||
− | + | ||
− | The default | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
==== Example ==== | ==== Example ==== | ||
Line 34: | Line 24: | ||
return</pre> | return</pre> | ||
− | + | ||
− | { | + | =See Also= |
− | + | {{Namespace}} | |
− | + | ||
− | + | ||
− | { | + | |
− | + | ||
− | + | ||
− | + |
Latest revision as of 12:25, 13 September 2007
Synopsis
nameSpace pop
Description
The namespace pop command restores the current namespace name and scope from an internal stack.
The default namespace is named STD and has local scope. This namespace is restored when the script is stopped, or there are no previous namespaces defined at the point that a nameSpace pop occurs.
Example
set !return ; make sure !return is empty gosub test display ok !return halt sub test nameSpace Push ; saves current namespace nameSpace Local Test ; create a new temporary namespace to work with set !return this_is_a_test nameSpace Pop ; restore previous namespace nameSpace Copy ret* From Local Test ; copy variables to the original namespace nameSpace Push ; saves current namespace nameSpace Local Test nameSpace Clear ; free memory used by temporary namespace nameSpace Pop ; restore previous namespace return
See Also
Namespace
- Commands to interact with namespaces and their related variables.
nameSpace local | Defines the current namespace and its scope |
nameSpace global | Defines the current namespace and its scope |
nameSpace clear | Clears every variables within the current namespace |
nameSpace push | Stores the current namespace name and scope |
nameSpace pop | Restores the current namespace name and scope |
nameSpace copy | Copy variables from one namespace to another |