ahkgetvar


ahkgetvar is used to get a value from a variable in script.

Value:=DllCall(dll_path "\ahkgetvar","Str","var","UInt",getPointer,"Cdecl Str")

Parameters

Parameter

Description

Value

ahkgetvar() returns the value of a variable as string.

var

name of variable to get value from.

getPointer

set to 1 to get pointer of variable to use with Alias(), else 0 to get the value.

Return Value

Cdecl Str - return value is always a string, add 0 to convert to integer if necessary, especially when using getPointer.

Remarks

ahkgetvar returns empty if variable does not exist or is empty.

Related

AutoHotkey.dll, ahkdll, ahktextdll, ahkReady, addFile, addScript, ahkExec, ahkLabel, ahkFunction, ahkPostFunction, ahkassign, ahkTerminate, ahkReload, ahkFindFunc, ahkFindLabel, ahkPause, ahkExecuteLine, Alias, cacheEnable, FindFunc, FindLabel, getTokenValue, getVar, Static, AutoHotkeyMini, DynaCall, CriticalSection, CriticalObject, MemoryLoadLibrary, ResourceLoadLibrary, MemoryGetProcAddress, MemoryFreeLibrary, Other Changes

Example

AhkDll:=AhkDllObject("AutoHotkey.dll")
AhkDll.ahktextdll() ;start empty thread, in this mode #Persistent and #NoTrayIcon will be default
ahkdll.ahkassign.a:="test"
MsgBox % ahkdll.ahkgetvar.a ;same as ahkdll.ahkgetvar("a") or ahkdll.ahkgetvar["a"]