addScript


addScript is used to append additional labels and functions from text or variable to the running script from text/variable.

pointerLine:=DllCall(dll_path "\addScript","Str","MsgBox % A_Now"[,"Uchar",Execute,],"Cdecl UPTR")

Parameters

Parameter

Description

pointerLine

addScript() returns a pointer to the first line in the late included script.

("MsgBox...")

script as text(or variable containing text) added to the running script.

Execute

0 = add only but do not execute.
1 = add script and start execution.
2 = add script and wait until executed

Return Value

Cdecl UInt - return value is a pointer to the first line of new created lines.

Remarks

Line pointer can be used in ahkExecuteLine() to execute one line only or until a return is encountered.

Related

AutoHotkey.dll, ahkdll, ahktextdll, ahkReady, addFile, ahkExec, ahkLabel, ahkFunction, ahkPostFunction, ahkassign, ahkgetvar, 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() ;Starts empty thread in #Persistent + #NoTrayIcon mode
ahkDll.addScript("Sub:`nMsgbox Sub`nReturn",0) ;add but do not execute
MsgBox Script was added`nPress OK to GoSub
ahkDll.ahkLabel.Sub