The source is now available for this compiled script but is still a bit of a mess. Enjoy , and Please report any bugs if found.
This utility does not currently check for missing functions detected in a script in #Include files or in the Standard or User libraries. This utility was mainly designed to check scripts for external function dependencies to help when determining the files that need to be included with a script when distributing.
Download v0.03beta (194k)
Comments and/or suggestions welcome ...
; ********************************************************************************** ; ** Ahkx_fdeps v0.0.2 by corrupt modified: September 2, 2007 ; ********************************************************************************** ; <COMPILER: v1.0.47.04> #NoTrayIcon about = fdeps v0.03beta - by corrupt (Ahkx series) ; ********************************************************************************** ; ** - Check if a script has been specified. Terminate if not specified. ; ********************************************************************************** path1 = %1%%2%%3%%4%%5%%6%%7%%8%%9% If path1= FileSelectFile, path1, 3,, Please select an AutoHotkey file to test, AutoHotkey scripts (*.ahk; *.ahkx) If path1= { MsgBox, 16, %about%, Error: File not specified., 2 ExitApp } ; ********************************************************************************** ; ** retrieve script & initialize values ; ********************************************************************************** FileRead, ReadVar, %path1% spos := 1 funct := "," ; ********************************************************************************** ; ** remove comments ; ********************************************************************************** OutputVar := RegExReplace(ReadVar, "m)(?:(?:^\s*\;[^\n]*$)|(?:\s+\;[^\n]*$)|(?:\s*\/\*(?:.*\R)*?\*\/))", "") ; ********************************************************************************** ; ** - remove continuation lines (method#2) ; ********************************************************************************** OutputVar := RegExReplace(OutputVar, "`am)^\((?:.*\R)*\)", "") ; ********************************************************************************** ; ** remove quoted items (same line) ; ********************************************************************************** OutputVar := RegExReplace(OutputVar, "m)(?:("""")|(""[^\n]*""))", "") ; ********************************************************************************** ; ** - determine function references and included functions ; ** - known issue: function references may be detected within multi-line quotes, ; ** literal text is not currently ignored in commands (possibly fixed in a later release) ; ********************************************************************************** Loop, { FoundPos := RegExMatch(OutputVar, "m)([^[#_@\$\?\[\]a-zA-Z0-9\n]*)([a-zA-Z0-9\_]+)\([^\n]*(?:\)|\R,.*\))[\s\R]*(\{?)\S?", func, spos) If !(FoundPos) break If func3={ { If func1= Built_in .= "," . func2 } Else funct .= func2 . "," spos := FoundPos + StrLen(func1) + StrLen(func2) ; - 1 } ; ********************************************************************************** ; ** exclude built-in functions/syntax exceptions ; ********************************************************************************** Built_in .= ",NumGet,NumPut,RegisterCallback" Built_in .= ",If,FileExist,GetKeyState,InStr,RegExMatch,RegExReplace,SubStr,StrLen,WinActive,WinExist,Asc,Chr,IsLabel,DllCall" Built_in .= ",OnMessage,VarSetCapacity,Abs,Ceil,Exp,Floor,Log,Ln,Mod,Round,Sqrt,Sin,ASin,ACos,ATan,LV_Add,LV_Insert" Built_in .= ",LV_Modify,LV_Delete,LV_ModifyCol,LV_InsertCol,LV_DeleteCol,LV_GetCount,LV_GetText,SB_SetText,TV_Add,TV_Modify" Built_in .= ",TV_Delete,TV_GetSelection,TV_GetCount,TV_GetParent,TV_GetChild,TV_GetPrev,TV_GetNext,TV_GetText,TV_Get,IL_Destroy,, ," ; ********************************************************************************** ; ** - build function list and generate output ; ********************************************************************************** Loop, Parse, funct, `, { If !InStr(Built_in, "," . A_LoopField . ",") { Built_in .= A_LoopField . "," If A_LoopField is not digit A_out .= A_LoopField . ", " } } If A_out= MsgBox, 64, %about%, Unresolved function references not detected. Else { StringTrimRight, A_out, A_out, 2 MsgBox, 48, %about%, % "Possible unresolved function references detected: `n`n" . A_out } ExitApp