Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva
 

__mvScope()

If variable exists then returns its scope.
Syntax
__mvScope( <cVarName> )
Argument(s)
<cVarName> = a string with a variable name to check
Returns
The symbolic values are defined in hbmemvar.ch HB_MV_NOT_FOUND =variable is not declared (not found in symbol table) HB_MV_UNKNOWN =if variable doesn't exist (but found in symbol table) HB_MV_ERROR =if information cannot be obtained (memory error or argument error) HB_MV_PUBLIC =for public variables HB_MV_PRIVATE_GLOBAL =for private variables declared outside of current function/procedure HB_MV_PRIVATE_LOCAL =for private variables declared in current function/procedure
Example(s)
PROCEDURE Main()
   PUBLIC mPublic
   PRIVATE mPrivateGlobal
   CallProc()
   ? __mvScope( "mPrivateLocal" )      // HB_MV_UNKNOWN
   RETURN
PROCEDURE CallProc()
   PRIVATE mPrivateLocal
   ? __mvScope( "mPublic" )            // HB_MV_PUBLIC
   ? __mvScope( "mPrivateGlobal" )     // HB_MV_PRIVATE_GLOBAL
   ? __mvScope( "mPrivateLocal" )      // HB_MV_PRIVATE_LOCAL
   ? __mvScope( "mFindMe" )            // HB_MV_NOT_FOUND
   IF __mvScope( "mPublic" ) > HB_MV_ERROR
      ? "Variable exists"
   ELSE
      ? "Variable not created yet"
   ENDIF
   RETURN
Status
Ready
Compliance
This is Harbour specific
File(s)
Library is core
See also

include/hbmemvar.ch