# StackOffset
{: .no_toc }

Returns the stack-frame offset of a variable.

Syntax: **StackOffset(** *Variable* **)** **As Long**

*Variable*
: *required* A local variable, argument, or other stack-resident reference. The value passed is taken **As Any** so the call works for any type.

The result is the offset, in bytes, from the procedure's stack frame base to the storage of *Variable*. Typically used inside a **Naked** procedure to compute addresses for inline assembly emitted with [**Emit**](/tB/Modules/HiddenModule/Emit.md) or [**EmitAny**](/tB/Modules/HiddenModule/EmitAny.md). The offset is resolved at compile time and folded in as a numeric constant.

### See Also

- [StackArgsSize](/tB/Modules/HiddenModule/StackArgsSize.md) function
- [Emit](/tB/Modules/HiddenModule/Emit.md), [EmitAny](/tB/Modules/HiddenModule/EmitAny.md) procedures
- [Direct Assembly Insertion](/Features/Advanced/Assembly.md)
