__mvXRelease()

Template

Function

Name

__mvXRelease()

Category

API

Subcategory

Variable management

Oneliner

This function releases value stored in PRIVATE or PUBLIC variable

Syntax

      __mvXRelease( <variable_name> )

Arguments

<variable_name> = either a string that contains the variable’s name or an one-dimensional array of strings with variable names No skeleton are allowed here.

Returns

Nothing

Description

This function releases values stored in memory variable. It shouldn’t be called directly, rather it should be placed into RELEASE command. If the released variable is a PRIVATE variable then previously hidden variable with the same name becomes visible after exit from the procedure where released variable was created. If you access the released variable in the same function/procedure where it was created the the NIL value is returned. You can however assign a new value to released variable without any side effects.

It releases variable even if this variable was created in different procedure

Examples

      PROCEDURE Main()
         PRIVATE mPrivate

         mPrivate := "PRIVATE from Main()"
         ? mPrivate     //PRIVATE from Main()
         Test()
         ? mPrivate     //PRIVATE from Main()

         RETURN

      PROCEDURE Main()
         PRIVATE mPrivate

         mPrivate := "PRIVATE from Main()"
         ? mPrivate           //PRIVATE from Main()
         RELEASE mPrivate
         ? mPrivate           //NIL
         mPrivate := "Again in Main()"

         RETURN

Compliance

Harbour

Files

Library is core

3 responses to “__mvXRelease()

  1. Pingback: Harbour Internal Functions | Viva Clipper !

  2. Pingback: Harbour Internal Functions | Viva Clipper !

  3. Pingback: Variable Management Functions | Viva Clipper !

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.