AutoHotkey Community

It is currently May 26th, 2012, 6:46 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 11th, 2008, 11:56 am 
Offline

Joined: May 3rd, 2007, 5:59 am
Posts: 24
Lexikos wrote:
LBJ wrote:
if (i:=RegExMatch(Pattern,"(?<=[*?])\"))
That would allow wildcards only at the end of the name. Notice the pattern I used in my test: ?u*y.


You're absolutely correct of course. :-)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2011, 6:50 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 336
Lexikos wrote:
What I didn't say is it's only of benefit if you specifically have a use for it. I don't. Thinking about it, though, I can understand how much better it would be for someone that has a need for it.

I think I mainly posted because xx3nvyxx's solution seemed overcomplicated, as does yours. Here is my crack at it:
Code:
Glob(list, "C:\Program Files\?u*y\*\*.exe")
MsgBox %list%

Glob(ByRef list, Pattern, IncludeDirs=0)
{
    if (i:=RegExMatch(Pattern,"[*?]")) && (i:=InStr(Pattern,"",1,i+1))
        Loop, % SubStr(Pattern, 1, i-1), 2
            Glob(list, A_LoopFileLongPath . SubStr(Pattern,i), IncludeDirs)
    else
        Loop, %Pattern%, %IncludeDirs%
            list .= (list="" ? "" : "`n") . A_LoopFileLongPath
}
It seems too simple... maybe I missed something? :lol:



Thanks Lexikos, I needed this today. :-)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2011, 2:47 pm 
I know this is super old but this is exactly what I needed today. Thanks a ton for the help


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2012, 6:16 pm 
Offline

Joined: May 22nd, 2010, 7:08 am
Posts: 37
I was hoping to use this in a simple cleanup script, but I receive an error message when trying to run this.

"Warning: using value of uninitialized variable

specifically list (a local variable with the same name as global)"

Pops up a couple of times, and then the script works. Anything I do to turn off the error message or correct the issue? Not exactly sure what it's barking at me for.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2012, 6:37 pm 
Remove #Warn from your script


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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