heresy
Joined: 11 Mar 2008 Posts: 269
|
Posted: Fri Jul 18, 2008 6:08 pm Post subject: Help() - Get in-line help |
|
|
i'd like to recommend to use majkinetor's ISense but if you prefer interpreter style and love msgbox, here it is.
you need to delete Lib\Funclist.txt each time when you installed newly functions to standard library
Example
| Code: | Help("Keys") ;keylists
Help("Vars") ;Built-in variables
Help("Mouse") ;Built-in Command, you don't have to type full texts
Help("RegExReplace") ;Built-in function
Help("Anchor") ;Stdlib |
| Code: | Help(p){
SplitPath, A_AhkPath,,Dir
If !FileExist(Dir . "\Funclist.txt")
Makelist(Dir)
FileRead, stdlib, %Dir%\Lib\Funclist.txt
Dir .= "\Extras\Editors\Syntax"
If (p="keys")
{
FileRead, keys, %Dir%\Keys.txt
Loop, Parse, keys, `n, `r
Output .= (StrLen(A_LoopField)<=5) ? A_LoopField A_Tab A_Tab : A_LoopField A_Tab
;Output .= A_LoopField A_Tab A_Tab
MsgBox % Output
Return
}
Else If (p="vars")
{
FileRead, vars, %Dir%\Variables.txt
Loop, Parse, vars, `n, `r
Output .= (StrLen(A_LoopField)<=6) ? A_LoopField A_Tab A_Tab : A_LoopField A_Tab
MsgBox % Output
Return
}
FileRead, cmds, %Dir%\Commands.txt
FileRead, funcs, %Dir%\Functions.txt
Loop, Parse, cmds, `n, `r ;Command list
{
If SubStr(A_LoopField,1,StrLen(p))=p
{
MsgBox % A_LoopField
Return
}
}
Loop, Parse, funcs, `n, `r ;Built-in Function list
{
If SubStr(A_LoopField,1,StrLen(p))=p
{
MsgBox % A_LoopField
Return
}
}
Loop, Parse, stdlib, `n, `r ;Standard library
{
If SubStr(A_LoopField,1,StrLen(p))=p
{
MsgBox % A_LoopField
Return
}
}
MsgBox, Not Found
}
MakeList(AhkPath){
Loop, %AhkPath%\Lib\*.ahk
{
Loop, Read, %A_LoopFileLongPath%
{
If RegExMatch(A_LoopReadLine,"Si)^[a-z][\w]+\(.*\)", s)
FuncList .= s "`n"
}
}
FileAppend, %FuncList%, %AhkPath%\Lib\Funclist.txt
} |
_________________ Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com |
|