Difference between revisions of "NameSpace clear"

From Wiki
Jump to: navigation, search
(nameSpace clear)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{command header|Namespace Commands}}
== nameSpace clear ==
+
'''Namespace commands'''
+
  
=== Synopsis ===
+
{{body|nameSpace clear|''(Added in 1.39)'' The '''[[Documentation#Namespace|Namespace]]''' clear command clears every variables within the current [[Documentation#Namespace|Namespace]].
'''nameSpace''' clear  
+
  
=== Description ===
+
The default [[Documentation#Namespace|Namespace]] is [[Documentation#Namespace local|local]] and named STD. This setting is restored when the script is stopped.
(Added in 1.39) The '''nameSpace''' clear command clears every variables within the current [[namespace]].
+
}}
The default [[namespace]] is [[Namespace local|local]] and named STD. This setting is restored when the script is stopped.
+
  
''Note:''
+
 
''Currently only Local scope is available. Global scope is to be introduced in a future version of EasyUO.''
+
{{Note|Global namespaces are only available in EasyUO 1.5.}}
  
 
==== Example ====
 
==== Example ====
Line 32: Line 28:
 
return</pre>
 
return</pre>
  
=== See Also ===
+
 
{|
+
=See Also=
| Width=200px | [[nameSpace local]] || Width=200px | [[nameSpace global]] || Width=200px | [[nameSpace push]] || Width=200px | [[nameSpace pop]] || Width=200px | [[nameSpace copy]] || Width=200px | [[#nsType]] || Width=200px | [[#nsName]]
+
{{Namespace}}
|}
+
----
+
{|
+
| Width=200px | [[Main_Page]] || Width=200px | [[Documentation]] || Width=200px |
+
[[Documentation#Flow_Control|Flow Control]]
+
|}
+

Latest revision as of 13:25, 13 September 2007


Synopsis

nameSpace clear

Description

(Added in 1.39) The Namespace clear command clears every variables within the current Namespace.

The default Namespace is local and named STD. This setting is restored when the script is stopped.


Note: Global namespaces are only available in EasyUO 1.5.

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