ahkassign

Auto Hotkey

ahkassign

Exported function that assigns a string value to a variable in currently executed script.

OutputVar := DllCall("Module\ahkassign", "Str", "VarName", "Str", Value, "CDecl UInt")
Command  Example: DllCall "AutoHotkey.dll\ahkassign", "Str", "Variable", "Str", "100", "CDecl UInt"
                  DllCall "AutoHotkey.exe\ahkassign", "Str", "Variable", "Str", "100", "CDecl UInt"

Function Example: Result := DllCall("AutoHotkey.dll\ahkassign", "Str", "Variable", "Str", "100" ,"CDecl UInt")
                  Result := DllCall("AutoHotkey.exe\ahkassign", "Str", "Variable", "Str", "100", "CDecl UInt")

Parameters

OutputVar

The name of the variable in which to store the result, -1 on failure and 0 on success.

VarName

Name of the variable to assign value to.

Value

Value as String.

Related

ahkFindFunc, ahkFindLabel, ahkgetvar, DllCall

Examples

dllpath:=A_AhkDir "\AutoHotkey.dll"
DllCall("LoadLibrary","Str",dllpath) ; Load the AutoHotkey module.
DllCall(dllpath "\ahktextdll","Str","","Str","","CDecl") ; start a new thread from file.
DllCall(dllpath "\ahkassign","Str","var","Str","value","CDecl") ; assing value to var
MsgBox % DllCall(dllpath "\ahkgetvar","Str","var","UInt",0,"CDecl") ; wait for the thread to exit

; Same example like above using included AutoHotkey.dll
dll:=AhkThread()
dll.ahkassign("var","value")
MsgBox % dll.ahkgetvar.var