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 file misleading for newbie re Loop (files & folders

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
JimH



Joined: 11 Jan 2008
Posts: 1
Location: Papua New Guinea

PostPosted: Mon Jan 14, 2008 2:50 am    Post subject: Help file misleading for newbie re Loop (files & folders Reply with quote

Great program -- very powerful Smile

But as a newbie I found something misleading in the last example in the help page on
Loop (files & folders)

I copied the whole example into a script and dropped some folders onto it.

The variable LongPath was always blank Sad

Here's the example:

Code:
; Example #6: Convert filenames passed in via command-line parameters to long names,
; complete path, and correct uppercase/lowercase characters as stored in the file system.
Loop %0%  ; For each file dropped onto the script (or passed as a parameter).
{
    GivenPath := %A_Index%  ; Retrieve the next command line parameter.
    Loop %GivenPath%
        LongPath = %A_LoopFileLongPath%
    MsgBox The case-corrected long path name of file`n%GivenPath%`nis:`n%LongPath%
}


I didn't try dropping any plain files on the script, or I would have seen why.

I looked at some other examples people had posted, then read the documentation more carefully, and realised I needed to change

Loop %GivenPath%

to

Loop %GivenPath%, 1

to make it not ignore folders.

Can I suggest that the script in the help file be modified the same way, or that the comment at the beginning of the script be changed from

Example #6: Convert filenames passed in

to

Example #6: Convert filenames (of plain files, not folders) passed in

Hope this helps other newbies,
Jim
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon Jan 14, 2008 5:12 pm    Post subject: Reply with quote

I don't see an ambiguity (as we are not in Unix).
A filename is the name of a file, not of a folder.
If you have some evidence of otherwise, eg. somewhere in Microsoft's Web site, feel free to give the reference. Thanks.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List 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