release

Prev Next

Function Names

release

Description

This function is applied on varible names which are variable references in order to release the reference (linkage) to the target variable. Given no other lockups (other references linked to that variable, ongoing assignments calculated, ongoing transactions or in use by I/O function parameters) apply, then the target variable may be deleted.

All released references to variables turn into regular simple variables containing void values and no members. The same variable may be used as a reference again as long no array or structure members have been added to them.

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.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

Min. 1

Parameters

No.TypeDescription
1, etc.
code
variable
:string
Variable name

The specified variable(s) must reference another variable.

Exceptions

Variable is not a reference
Variable is protected
Variable is a function parameter which cannot be released

Examples

  Country[] = USA;
  Country[State] = Pennsylvania;
  Country[State,Town] = Wilkes Barre;

  wb[] =^ Country[State,Town];
  echo(wb[]);

  release( wb[] );

Output

Wilkes Barre
Try it yourself: Open LIB_Function_release.b4p in B4P_Examples.zip. Decompress before use.

See also

release all