Difference between revisions of "NameSpace pop"

From Wiki
Jump to: navigation, search
(Description)
Line 7: Line 7:
  
 
=== Description ===
 
=== Description ===
''(Added in 1.40)'' The '''[[Documentation#Namespace|Namespace]]''' pop commands restore the current [[Documentation#Namespace|Namespace]] name and scope from an internal stack.
+
The namespace pop command restores the current namespace name and scope from an internal stack.
  
The default [[Documentation#Namespace|Namespace]] is [[Documentation#Namespace local|local]] and named STD. This setting is restored when the script is stopped.
+
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.
 
+
 
+
''Note:''
+
''Currently only Local scope is available. Global scope is to be introduced in a future version of EasyUO.''
+
  
 
==== Example ====
 
==== Example ====

Revision as of 07:46, 25 August 2005

nameSpace pop

Namespace commands

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 local nameSpace global nameSpace clear nameSpace push nameSpace copy #nsType #nsName

Main_Page Documentation

Namespace