Alias()

Auto Hotkey

Alias

Convert a local variable to an alias to represent a different variable for example in another thread.

Alias VariableOrName, VariableOrPointer
Command  Example: Alias, "MyVar", VariableOrPointer
Function Example: Alias("MyVar", VariableOrPointer)

Parameters

VariableOrName

The name of Variable to convert to alias or the variable itself.

VariableOrPointer

A variable or a pointer to the variable to refer to.

Related

NumGet, DllCall, VarSetCapacity

Example

var:="Hello World!"
Alias(refvar, var)
MsgBox % refvar
refvar:="AutoHotkey"
MsgBox % var

; Same example using variable pointer
var:="Hello World!"
Alias(refvar, getvar(var))
MsgBox % refvar
refvar:="AutoHotkey"
MsgBox % var