Variable Management Functions

Variable Management

FieldBlock Return a code block that sets/gets a value for a given field
FieldWBlock Return a sets/gets code block for field in a given work area
HB_AParams Returns an array containing values of all parameters passed to a function, method or procedure
HB_ArgC Returns the number of command line arguments
HB_ArgCheck Checks existence of an internal switch on the command line
HB_ArgShift Updates HB_Arg* parameter list removing the 1-st one and replacing it by others
HB_ArgString Retrieves the vale of an internal switch set on the command line.
HB_ArgV Retrieves the value of a command line argument
HB_PIsByRef Determine if a parameter is passed by reference.
HB_PValue Retrieves the value of an argument.
HB_ValToStr Converts any scalar type to a string.
MemVarBlock Returns a codeblock that sets/gets a value of memvar variable
PCount Retrieves the number of arguments passed to a function.
Type Retrieves the type of an expression
ValType Retrieves the data type of an expression

__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