AutoHotkey Community

It is currently May 26th, 2012, 9:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: July 18th, 2008, 6:08 pm 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], Klark92 and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group