This documentation is archived and is not being maintained.

ISymbolWriter.DefineLocalVariable Method

Defines a single variable in the current lexical scope.

Namespace:  System.Diagnostics.SymbolStore
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Sub DefineLocalVariable ( _
	name As String, _
	attributes As FieldAttributes, _
	signature As Byte(), _
	addrKind As SymAddressKind, _
	addr1 As Integer, _
	addr2 As Integer, _
	addr3 As Integer, _
	startOffset As Integer, _
	endOffset As Integer _
)
'Usage
Dim instance As ISymbolWriter 
Dim name As String 
Dim attributes As FieldAttributes 
Dim signature As Byte()
Dim addrKind As SymAddressKind 
Dim addr1 As Integer 
Dim addr2 As Integer 
Dim addr3 As Integer 
Dim startOffset As Integer 
Dim endOffset As Integer

instance.DefineLocalVariable(name, attributes, _
	signature, addrKind, addr1, addr2, _
	addr3, startOffset, endOffset)

Parameters

name
Type: System.String

The local variable name.

attributes
Type: System.Reflection.FieldAttributes

A bitwise combination of the local variable attributes.

signature
Type: System.Byte()

The local variable signature.

addrKind
Type: System.Diagnostics.SymbolStore.SymAddressKind

The address types for addr1, addr2, and addr3.

addr1
Type: System.Int32

The first address for the local variable specification.

addr2
Type: System.Int32

The second address for the local variable specification.

addr3
Type: System.Int32

The third address for the local variable specification.

startOffset
Type: System.Int32

The start offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope.

endOffset
Type: System.Int32

The end offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope.

The startOffset and endOffset parameters are optional. If their value is zero, they are ignored and the variable is defined throughout the entire scope. If their value is nonzero, the variable falls within the offsets of the current scope.

You can call DefineLocalVariable multiple times for a variable of the same name that occurs multiple times in different offset ranges throughout a scope. (In this case, start and end offsets must not overlap.)

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: