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")
| 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. |
Line pointer can be used in ahkExecuteLine() to execute one line only or until a return is encountered.
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
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