AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help() - Get in-line help

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
heresy



Joined: 11 Mar 2008
Posts: 269

PostPosted: Fri Jul 18, 2008 6:08 pm    Post subject: Help() - Get in-line help Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group