NeedsAccessToLocalsAttribute Class | |
This class is used to mark methods, properties etc. that want access to Local Variables by name.
Inheritance Hierarchy
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
[AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property)]
public sealed class NeedsAccessToLocalsAttribute : Attribute
Request Example
View SourceThe NeedsAccessToLocalsAttribute type exposes the following members.
Constructors Properties 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