# ErrorStackFrame class

An **ErrorStackFrame** describes one procedure that was active on the call stack at the moment a run-time error was raised --- the project it belongs to, the module that contains it, and its own name. Frames are produced by iterating an [**ErrorCallstack**](/tB/Packages/VBRUN/ErrorCallstack/index.md) snapshot, which in turn is reachable from the [**Callstack**](/tB/Packages/VBRUN/ErrorContext/index.md#callstack) property of an [**ErrorContext**](/tB/Packages/VBRUN/ErrorContext/index.md). Every property is read-only.

> [!NOTE] BETA 1045
> twinBASIC code cannot obtain an **ErrorStackFrame** object, because it cannot obtain the [**ErrorContext**](/tB/Packages/VBRUN/ErrorContext/index.md) that leads to one. The sample below compiles, but no code can supply its argument.

```tb check_build id=errorstackframe-argument
Sub LogStackTrace(ByVal Stack As ErrorCallstack)
    Dim i As Long
    For i = 1 To Stack.Count
        Dim Frame As ErrorStackFrame
        Set Frame = Stack.Items(i)
        Debug.Print Frame.ProjectName & "." & Frame.ModuleName & "." & Frame.ProcedureName
    Next i
End Sub
```

## Members

### ModuleName

Returns the name of the module --- the standard module, class module, form, or user control --- that contains the procedure for this frame, as a **String**.

Syntax: *object*.**ModuleName**

*object*
: *required* An object expression that evaluates to an **ErrorStackFrame** object.

### ProcedureName

Returns the name of the procedure for this frame, as a **String**.

Syntax: *object*.**ProcedureName**

*object*
: *required* An object expression that evaluates to an **ErrorStackFrame** object.

For property accessors, this is the property name without the `Get`/`Let`/`Set` prefix; for event handlers, it is the compiler-generated handler name in the usual `<Object>_<Event>` form.

### ProjectName

Returns the name of the twinBASIC project that contains the procedure for this frame, as a **String**.

Syntax: *object*.**ProjectName**

*object*
: *required* An object expression that evaluates to an **ErrorStackFrame** object.

For frames from a referenced package or compiled DLL, this is the name of the originating project.
