addFile


addFile is used to append additional labels and functions from a file to the running script.

pointerLine:=DllCall(dll_path "\addFile","Str",file[,"Uchar",AllowDuplicateInclude,"Uchar",IgnoreLoadFailure],"Cdecl UPTR")

Parameters

Parameter

Description

pointerLine

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

file

name of script to be parsed and added to the running script

AllowDuplicateInclude

0 = if a script named %filename% is already loaded, ignore (do not load)
1 = load it again

IgnoreLoadFailure

0 = signal an error if there was problem addfileing filename
1 = ignore error
2 = remove script lines added by previous calls to addFile() and start executing at the first line in the new script [AutoHotkey.dll only]

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, addScript, 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
If ahkDll.addFile("MyScript.ahk") ;add but do not execute
MsgBox Script was added`nPress OK to exit
else
MsgBox Could not add script