Click or drag to resize

NeedsAccessToLocalsAttribute Class

X#
This class is used to mark methods, properties etc. that want access to Local Variables by name.
Inheritance Hierarchy
Object
  Attribute
    NeedsAccessToLocalsAttribute

Namespace:  XSharp.Internal
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
[AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property)]
 SEALED CLASS NeedsAccessToLocalsAttribute INHERIT Attribute
Request Example View Source

The NeedsAccessToLocalsAttribute type exposes the following members.

Constructors
  NameDescription
Public methodNeedsAccessToLocalsAttribute
Initializes a new instance of the NeedsAccessToLocalsAttribute class
Top
Properties
  NameDescription
Public propertyWritesToLocals
Top
Remarks
In FoxPro several built-in functions have access to locals "by name". We can't do that because it violates the normal rules of encapsulation. However we can "emulate" this behavior by adding this attribute to a function or method that wants access to locals. At runtime we will then populate a table in the runtime with the names and values of local variables And we can access this table with the normal MemVarGet() and MemVarPut() functions.
See Also