__MVSCOPE()
If variable exists then returns its scope.
- Syntax
- __MVSCOPE( <cVarName> )
- Arguments
- <cVarName> = a string with a variable name to check
- Returns
- The symbolic values are defined in include/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
- Examples
- 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 function is a Harbour Extension
- Files
- Library is vm
- See Also