AutoHotkey Community

It is currently May 25th, 2012, 6:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: August 30th, 2007, 2:17 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Andreone wrote:
Actually, c:\\ or c:\\dir\file are still valid paths. However, I understand it can be seen as dirty.


Honestly, I thought a little more than of cosmetic value, like it could create some problems in specific situations:

Code:
hModule := DllCall( "LoadLibrary", Str,WhereIs("MyThirdParty.DLL") )


Well! It works fine with double slash! Still, I prefer the function to conform to regular standard.

Quote:
During testing, I felt that msgboxes appeared faster when not calling PathAddBackslashA.


Oh! I will also experiment with RegEx ( I remember PhiLho giving me one )

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2007, 2:33 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
Code:
StringRight, CheckLastSlashSource, Source, 1
If CheckLastSlashSource = \
StringTrimRight, Source, Source, 1


:?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2007, 2:38 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
@tic: I know as that is the documented method. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2007, 2:49 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1832
:P sorry! was just wondering what all the commotion was about


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2007, 3:47 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
tic wrote:
wondering what all the commotion was about


We were tinkering a good idea and hence the commotion. :D

Anyways, here is a shortened version:

Code:
WhereIs( File ) {
 SplitPath, A_AhkPath,, A_AhkDir
 EnvGet, Dos, Path
 sPath=%A_WorkingDir%;%A_ScriptDir%;%A_AhkDir%;%A_AhkDir%\Lib;%A_MyDocuments%\AutoHotkey\Lib;%Dos%
 Loop, Parse, sPath, `;
     IfNotEqual, A_LoopField,, IfExist, %A_LoopField%\%File%
         Return, RegExReplace( A_LoopField "" File,  "\\\", "" )
 RegRead, AppPath, HKLM, SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\%File%
 IfExist, %AppPath%, Return, AppPath
}


Credit: I borrowed the function name and the Registry path from this <external link>

:)


Report this post
Top
 Profile  
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