release all
This function releases all reference variable either in the specified variable or in one of its members or sub-members.
If no parameter is specified, then all locally defined references to variables (for example in a user-defined functions) will be released.
All released references to variables turn into regular variables containing void values. See release() for further details.
In contrast to release(), no exception is asserted if the specified variable is neiter a reference to a variable nor containing references.
This setup allows to release all references in variables which contain a mix of direct contents and references and carries out an effective clean-up.
Protected variables as well as function parameters containing references will not be released.
References defined in local variables will be released automatically when execution of user-defined functions or B4P programs called with start() or include() have been completed.
Indirect parameter passing is disabled
Min. 0
No. | Type | Description |
---|---|---|
1, etc. code |
variable :string |
Variable name The specified variable(s) may (but must not necessarily) contain variable references. No actions if the variable contains no references at all. |
Country[] = USA;
Country[State] = Pennsylvania;
Country[State,Town] = Wilkes Barre;
a[wb] = ^Country[State,Town];
a[pa] = ^Country[State];
a[us] = The United States;
b[] = '';
echo(a[wb],", ", a[pa],", ", a[us]);
release all( a[] ); // Also try: release all;
echo(a[wb],", ", a[pa],", ", a[us]);
Wilkes Barre, Pennsylvania, The United States
# Invalid Value #, # Invalid Value #, The United States